]> rtime.felk.cvut.cz Git - frescor/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)
commitf8ce5263a02097287d60b081e9c426bfd3a96702
tree3a72bb3ed02fb50442dd20325943c57ddd3d178a
parentab45858c61e9623e6fef7fee9cbc35295c952f86
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-internal.h
src/forb.c
src/forbrun/forbrun.c
src/forbrun/tests/forbrun_printargs.c