event: generic event refactoring
authorarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 14 Mar 2011 12:01:12 +0000 (12:01 +0000)
committerarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 14 Mar 2011 12:01:12 +0000 (12:01 +0000)
commita97e90d132f28738a92e709a543348e325ebe095
tree4d7058dfa31486c8d1ee52ed9c88e54ab9a4ed2c
parent896165767324f541dc0598d41504076632abae61
event: generic event refactoring

Fix the behaviour of the following primitives:

 - event_waitTimeout(): this is now implemented using a single
   sig_wait() on the event's embedded sigmask. The timeout is notified
   using a custom timer handler that sends the signal SIG_TIMEOUT to the
   same event's embedded sigmask. This also fixes the hard-fault bug
   reported by Nicolas Dandrimont:
   (http://lists.develer.com/pipermail/bertos/2011-March/003164.html)

 - event_select(): multiple event wait routine. Implement this
   functionality mapping multiple events to different signal bits of the
   process's sigmask and performing a single sig_wait() on that mask.
   Signal bits are "allocated" internally by the event_select() itself and
   must not be provided by the user.

NOTE: event_select() should be still considered an experimental feature,
so the API may change in the future (as reported in the documentation).

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4769 38d2e660-2303-0410-9eaa-f027e97ec537
bertos/mware/event.c
bertos/mware/event.h