Fusion:Skirmish

From DirectFBWiki

A skirmish is a lock that can be held by zero or one holders at any time, and you can block waiting for the lock if you like. In other words, it’s a mutex. You initialize the lock variable with fusion_skirmish_init(). When you’re done with it fusion_skirmish_destroy() releases whatever resources it’s using.

In the single-app configuration, the lock maps directly to a pthread mutex as follows:

fusion pthreads
fusion_skirmish_init() pthread_mutex_init(PTHREAD_MUTEX_RECURSIVE)
fusion_skirmish_destroy() pthread_mutex_destroy()
fusion_skirmish_prevail() pthread_mutex_lock()
fusion_skirmish_swoop() pthread_mutex_trylock()
fusion_skirmish_dismiss() pthread_mutex_unlock()

Multi-app: In the multi-app configuration the fusion device keeps the actual lock information. A fusionee may lock a skirmish multiple times, and it must unlock it just as many times before it can be locked by another fusionee.