Skip to content
Snippets Groups Projects
Commit 0da3cabb authored by deuce's avatar deuce
Browse files

Add a function which triggers an OperationCallback() in every context of

every runtime.
parent 8f01fa4b
No related branches found
No related tags found
No related merge requests found
...@@ -126,3 +126,22 @@ void DLLCALL jsrt_Release(JSRuntime *rt) ...@@ -126,3 +126,22 @@ void DLLCALL jsrt_Release(JSRuntime *rt)
} }
#endif #endif
} }
void DLLCALL jsrt_TriggerAll(void)
{
#ifdef USE_JS_OPERATION_CALLBACK
int i;
int j;
JSContext *iterp,*cx;
for(i=0; i<JSRT_QUEUE_SIZE; i++) {
pthread_mutex_lock(&jsrt_mutex);
if(jsrt_queue[i].used) {
iterp=NULL;
while((cx = JS_ContextIterator(jsrt_queue[i].rt, &iterp)) != NULL)
JS_TriggerOperationCallback(cx);
}
pthread_mutex_unlock(&jsrt_mutex);
}
#endif
}
...@@ -38,6 +38,7 @@ extern "C" { ...@@ -38,6 +38,7 @@ extern "C" {
#endif #endif
DLLEXPORT JSRuntime * DLLCALL jsrt_GetNew(int maxbytes, unsigned long timeout, const char *filename, long line); DLLEXPORT JSRuntime * DLLCALL jsrt_GetNew(int maxbytes, unsigned long timeout, const char *filename, long line);
DLLEXPORT void DLLCALL jsrt_Release(JSRuntime *); DLLEXPORT void DLLCALL jsrt_Release(JSRuntime *);
DLLEXPORT void DLLCALL jsrt_TriggerAll(void);
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment