]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/commit
forb: Fix synchronization error in forbrun
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 20 Feb 2011 09:42:58 +0000 (10:42 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 20 Feb 2011 10:00:48 +0000 (11:00 +0100)
commit63aeaf83152befc7bb438b04b9921f1988d0011b
treef1a684152e7c80610a08d32e756665a2a6a9ba24
parent9cbab40ddab3ddf4d93f8b86c194ec19f1a0c01e
forb: Fix synchronization error in forbrun

forbrun starts servers synchronously, i.e. the next server is started
only after the previous one is fully initialized (see
forb_signal_server_ready()). This synchronization was broken because
forb_signal_server_ready() was incorrectly called in
forb_execute_object() called from forb_execution_thread() called from
forb_init(). This caused that the semaphore for the synchronization had
the value of one (instead of zero) when forb_init() finished.
Therefore, the first waiting for the semaphore returned immediately
without actually waiting for the server.

This is now fixed by introduction of default_executor which is declared
in struct forb. This executor is initialized "manually", without
forb_execute_object(), so that the forb_signal_server_ready() is not
called.

In future, we might want use the default executor for executing requests
to other objects, which do not require a separate thread.
src/forb/src/forb-internal.h
src/forb/src/forb.c
src/forb/src/forbrun/forbrun.c
src/forb/src/forbrun/tests/forbrun_printargs.c