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

Function cmd_sem_unlock

v2/engine/make1.c:1424–1458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1422}
1423
1424static void cmd_sem_unlock( TARGET * t )
1425{
1426 CMD * cmd = ( CMD * )t->cmds;
1427 TARGETS * iter;
1428 /* Release the semaphores. */
1429 for ( iter = cmd->unlock; iter; iter = iter->next )
1430 {
1431 if ( DEBUG_EXECCMD )
1432 printf( "SEM: %s is now free\n", object_str(
1433 iter->target->name ) );
1434 --iter->target->asynccnt;
1435 assert( iter->target->asynccnt <= 0 );
1436 }
1437 for ( iter = cmd->unlock; iter; iter = iter->next )
1438 {
1439 /* Find a waiting target that's ready */
1440 while ( iter->target->parents )
1441 {
1442 TARGETS * first = iter->target->parents;
1443 TARGET * t1 = first->target;
1444
1445 /* Pop the first waiting CMD */
1446 if ( first->next )
1447 first->next->tail = first->tail;
1448 iter->target->parents = first->next;
1449 BJAM_FREE( first );
1450
1451 if ( cmd_sem_lock( t1 ) )
1452 {
1453 push_state( &state_stack, t1, NULL, T_STATE_MAKE1C );
1454 break;
1455 }
1456 }
1457 }
1458}
1459
1460#endif

Callers 1

make1c_closureFunction · 0.85

Calls 3

object_strFunction · 0.85
cmd_sem_lockFunction · 0.85
push_stateFunction · 0.85

Tested by

no test coverage detected