MCPcopy Create free account
hub / github.com/boostorg/build / cmd_sem_unlock

Function cmd_sem_unlock

src/engine/make1.cpp:1480–1514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1478}
1479
1480static void cmd_sem_unlock( TARGET * t )
1481{
1482 CMD * cmd = ( CMD * )t->cmds;
1483 TARGETS * iter;
1484 /* Release the semaphores. */
1485 for ( iter = cmd->unlock; iter; iter = iter->next )
1486 {
1487 if ( DEBUG_EXECCMD )
1488 out_printf( "SEM: %s is now free\n", object_str(
1489 iter->target->name ) );
1490 --iter->target->asynccnt;
1491 assert( iter->target->asynccnt <= 0 );
1492 }
1493 for ( iter = cmd->unlock; iter; iter = iter->next )
1494 {
1495 /* Find a waiting target that's ready */
1496 while ( iter->target->parents )
1497 {
1498 TARGETS * first = iter->target->parents;
1499 TARGET * t1 = first->target;
1500
1501 /* Pop the first waiting CMD */
1502 if ( first->next )
1503 first->next->tail = first->tail;
1504 iter->target->parents = first->next;
1505 BJAM_FREE( first );
1506
1507 if ( cmd_sem_lock( t1 ) )
1508 {
1509 push_state( &state_stack, t1, NULL, T_STATE_MAKE1C );
1510 break;
1511 }
1512 }
1513 }
1514}
1515
1516#endif

Callers 1

make1c_closureFunction · 0.85

Calls 4

out_printfFunction · 0.85
object_strFunction · 0.85
cmd_sem_lockFunction · 0.85
push_stateFunction · 0.85

Tested by

no test coverage detected