Boost logo

Boost-Build :

Subject: [Boost-build] How to use semaphores
From: olan (o.andriyanov_at_[hidden])
Date: 2018-01-22 15:20:36


Hi!

I can't get semaphores working (
http://www.boost.org/build/doc/html/jam/language.html#jam.language.variables.builtins.semaphores
).

I have the following jamroot.jam:

import notfile ;

notfile foo : @sleep ;
notfile bar : @sleep ;
actions sleep {
 Â Â Â  sleep 1
}
JAM_SEMAPHORE on foo bar = s ;

And I build this project with 'b2 -j2'.

I expect build to be complete in 2 seconds since targets 'foo' and 'bar'
are supposed to be serialized, but it completes just in one second, no
matter what.

Unfortunately, I haven't found any working examples of using
JAM_SEMAPHORE. The only ones I found were located deeply in boost.build
source files and specified serialized targets indirectly, like $(targets).

Could someone please provide an example of how to properly serialize
execution of two actions with boost.build?


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk