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>
1 file changed
tree: 6d23c86f3726ba5744bd7492050e7e0eb726d0d6
  1. .gitignore
  2. CONTRIBUTING
  3. LICENSE
  4. Makefile
  5. copyleft-next-0.3.1
  6. main.c