try to fix eating

If we place the lock when eating we try to ensure everyone
takes food, but the state machine is all messed up still.
The trash is still not being dealt with at all.

This is still broken, we need a way to ensure so that
the mutex is held also for the trash, likewise for the
accounting which provides the simple state machine.

Run 1:

Before party:
FOOD:  [ ******************************* ]
TRASH: [                                 ]

After party:
FOOD:  [  ****************************** ]
TRASH: [ ******************************* ]

Run 2:

Before party:
FOOD:  [ ******************************* ]
TRASH: [                                 ]

After party:
FOOD:  [ * ***************************** ]
TRASH: [ ******************************* ]

Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
diff --git a/main.c b/main.c
index f977ce8..5f589cc 100644
--- a/main.c
+++ b/main.c
@@ -42,6 +42,7 @@
 	bool eat_in_order = true;
 	long t;
 
+	pthread_mutex_lock(&party->mutex);
 	/* If anyone ate out of place lets take notice of that... */
 	for (t=0; t < NUM_THREADS; t++) {
 		if (t == tid)
@@ -56,6 +57,7 @@
 	if (party->food[tid])
 		if (eat_in_order)
 			party->food[tid] = 0;
+	pthread_mutex_unlock(&party->mutex);
 }
 
 void cleanup(long tid)