|
@@ -41,6 +41,7 @@ static int active_hook_cnt = 0;
|
|
void _starpu_init_progression_hooks(void)
|
|
void _starpu_init_progression_hooks(void)
|
|
{
|
|
{
|
|
STARPU_PTHREAD_RWLOCK_INIT(&progression_hook_rwlock, NULL);
|
|
STARPU_PTHREAD_RWLOCK_INIT(&progression_hook_rwlock, NULL);
|
|
|
|
+ STARPU_HG_DISABLE_CHECKING(active_hook_cnt);
|
|
}
|
|
}
|
|
|
|
|
|
int starpu_progression_hook_register(unsigned (*func)(void *arg), void *arg)
|
|
int starpu_progression_hook_register(unsigned (*func)(void *arg), void *arg)
|
|
@@ -85,14 +86,7 @@ void starpu_progression_hook_deregister(int hook_id)
|
|
|
|
|
|
unsigned _starpu_execute_registered_progression_hooks(void)
|
|
unsigned _starpu_execute_registered_progression_hooks(void)
|
|
{
|
|
{
|
|
- /* If there is no hook registered, we short-cut loop. */
|
|
|
|
- if (STARPU_PTHREAD_RWLOCK_TRYRDLOCK(&progression_hook_rwlock))
|
|
|
|
- /* It is busy, do not bother */
|
|
|
|
- return;
|
|
|
|
- int no_hook = (active_hook_cnt == 0);
|
|
|
|
- STARPU_PTHREAD_RWLOCK_UNLOCK(&progression_hook_rwlock);
|
|
|
|
-
|
|
|
|
- if (no_hook)
|
|
|
|
|
|
+ if (active_hook_cnt == 0)
|
|
return 1;
|
|
return 1;
|
|
|
|
|
|
/* By default, it is possible to block, but if some progression hooks
|
|
/* By default, it is possible to block, but if some progression hooks
|