After removing the explicit locking, there is a small
race in case of a "floundering" (simulated) subsystem:
the starting context may go away before the child thread
actually teminates. I consider this a shortcoming of
this test fixture, which isn't intended to be an example
of a real world subsystem, but rather focusses on
error detection within the subsystem runner.
Added some more fuzz and sleeping to the test calculation to have a actual
chance to fail when something is not well locked.
Using a premature classlock, locking instances was insufficient.
After acquired, the caller 'owns' the thread handle and can inspect it,
the associated thread is defined to be waiting for a wakeup signal
(and then one shouldn't do unlocked access to the thread handle)
* commit 'dc87e78590ea86615d3ebe90d23af4548445b941':
add a two-thread acquire test
show the state of the thread in question
minor fixes: remove an old comment and change another
fix the prime test algorithm
use unsigned long for even more digits!
using new thread synchronization
Disabled further tests, making one after another working.
Some notes:
* currently running this leads to different outcomes on differnt runs,
there are some races/unsyncronized things left, to be investigated.
* I suggest to make Subsystems joinable, this prolly needs some work in
the error handling department (thread-wrapper.hpp too)
* using nonrecursive/waitable lock, recursive locks are have some bad
taste unless absolutely necessary
* after all a timed lock with polling is not the right approach to check
for subsystem shutdowns, I opted against thread cancelation because of
its programming overhead and complexity. We may refine this and allow
synchronous cancellation (with an approbiate thread flag) in some cases.
This removes the explicit Sync things from the thread wraper since
the functionality is almost exactly provided by the backend.
Thread encapsulates a lumiera thread handle now, but this is strictly
optional and might be dropped on the floor (using a temporary as thread).
Thread has a sync() function which allows user controlled syncronous
startup:
Thread("foo", myoperation).sync();
will startup myoperation and only return from the ctor after myoperation
called a matching lumiera_thread_sync().
The related tests need to initialize/destroy the threadpool accordingly
adds a state to each threadpool which can be only offline or online.
One can not acquire new threads when the pool is offline.
no need for waits in the teststuite anymore.
* plouj/second-tp-attempt: (68 commits)
partially fix a pkg-config problem with scons on Fedora12
fix comilation by using an existing TEST macro
more formatting fixes to put spaces before function/macro call opening brackets
add a stronger REQUIRE check
ignore RESOURCE_ANNOUNCE in tests
fix the code by re-merging some of cehteh's changes
remove redundant info from TRACE
match the filename in the header comment
add a thread state check and remove an old comment
python-2.6 fix: loading the icon_rener.py script (Ticket #222)
Use a fully qualified name for PlacementMO in PlacementIndex
fix compilation errors
die regardless of what type of failure pthread_create() encounters
mark thread as worker
remote unnecessary calls to llist_unlink() insert is enough
continuation of working_list introduction
begin adding a second list to store working threads
merge ECHO with TRACE
don't expect any more output from the basic test
fix compilation
...
Conflicts:
src/tool/Makefile.am
tests/Makefile.am
* refactor configure.ac to have distinct sections to configure each
subsystem.
* Dedicated LUMIERA_<subsys>_CFLAGS|_LIBS vars
* Fix Makefile.am's to use them, remove unnecessary dependencies
Stray dependencies to be refacored:
* tests/Makefile.am has dependencies on proc and backend
- should be moved to tests/library/Makefile.am etc anyways
* tests/lib/Makefile.am has dependency on GUI left
* src/tool/Makefile.am links GUI stuff generally, thats ok
* one threading test is broken, we don't care, merging new threadpool in
next.