
Trying to lock fs->lock inside jclose() is useless and counterproductive,
because the race with pthread_mutex_destroy() is unavoidable, and the caller
must take care of not calling jclose() concurrently anyways.


---

 cur-root/trans.c |    2 --
 1 files changed, 2 deletions(-)

diff -puN trans.c~close_locking trans.c
--- cur/trans.c~close_locking	2004-08-28 21:23:15.995794528 -0300
+++ cur-root/trans.c	2004-08-28 21:41:11.323319896 -0300
@@ -625,7 +625,6 @@ int jclose(struct jfs *fs)
 	int ret;
 
 	ret = 0;
-	pthread_mutex_lock(&(fs->lock));
 
 	if (jsync(fs))
 		ret = -1;
@@ -641,7 +640,6 @@ int jclose(struct jfs *fs)
 	if (fs->jmap != MAP_FAILED)
 		munmap(fs->jmap, sizeof(unsigned int));
 
-	pthread_mutex_unlock(&(fs->lock));
 	pthread_mutex_destroy(&(fs->lock));
 
 	return ret;
_
