aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--weasel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/weasel.c b/weasel.c
index 41e53b3..c71531d 100644
--- a/weasel.c
+++ b/weasel.c
@@ -191,7 +191,6 @@ intercourse()
c[i] = pickrandom(population);
assert(c[i]);
}
- pthread_mutex_unlock(&mutexsum);
qsort(c, 3, sizeof(Creature *), cmp);
for (i = 0; i < c[2]->length; i++) {
@@ -210,6 +209,7 @@ intercourse()
c[0]->locked = 0;
c[1]->locked = 0;
c[2]->locked = 0;
+ pthread_mutex_unlock(&mutexsum);
pthread_exit(NULL);
}