Skip to content

Commit

Permalink
Switched enkiGetIsRunning() C function to use !GetIsShutdownRequested…
Browse files Browse the repository at this point in the history
…() and marked deprecated
  • Loading branch information
dougbinks committed May 29, 2024
1 parent 9e588fd commit 686d0ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/TaskScheduler_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ struct enkiTaskSchedulerConfig enkiGetTaskSchedulerConfig( enkiTaskScheduler* pE

int enkiGetIsRunning( enkiTaskScheduler* pETS_ )
{
return (int)pETS_->GetIsRunning();
return (int)(!pETS_->GetIsShutdownRequested());
}

int enkiGetIsShutdownRequested(enkiTaskScheduler* pETS_)
Expand Down
2 changes: 1 addition & 1 deletion src/TaskScheduler_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ ENKITS_API enkiTaskScheduler* enkiNewTaskSchedulerWithCustomAllocator( struct e
// Get config. Can be called before enkiInitTaskSchedulerWithConfig to get the defaults
ENKITS_API struct enkiTaskSchedulerConfig enkiGetTaskSchedulerConfig( enkiTaskScheduler* pETS_ );


// DEPRECATED: use GetIsShutdownRequested() instead of GetIsRunning() in external code
// while( enkiGetIsRunning(pETS) ) {} can be used in tasks which loop, to check if enkiTS has been shutdown.
// If enkiGetIsRunning() returns false should then exit. Not required for finite tasks
ENKITS_API int enkiGetIsRunning( enkiTaskScheduler* pETS_ );
Expand Down

0 comments on commit 686d0ec

Please sign in to comment.