本文整理汇总了C++中JSD_UNLOCK函数的典型用法代码示例。如果您正苦于以下问题:C++ JSD_UNLOCK函数的具体用法?C++ JSD_UNLOCK怎么用?C++ JSD_UNLOCK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了JSD_UNLOCK函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: jsd_SetErrorReporter
JSBool
jsd_SetErrorReporter(JSDContext* jsdc,
JSD_ErrorReporter reporter,
void* callerdata)
{
JSD_LOCK();
jsdc->errorReporter = reporter;
jsdc->errorReporterData = callerdata;
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:Creativegame,项目名称:Spidermonkey,代码行数:11,代码来源:jsd_high.c
示例2: jsd_GetScriptHook
JSBool
jsd_GetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc* hook, void** callerdata)
{
JSD_LOCK();
if( hook )
*hook = jsdc->scriptHook;
if( callerdata )
*callerdata = jsdc->scriptHookData;
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:RickEyre,项目名称:mozilla-central,代码行数:11,代码来源:jsd_scpt.cpp
示例3: jsd_EnableSingleStepInterrupts
JSBool
jsd_EnableSingleStepInterrupts(JSDContext* jsdc, JSDScript* jsdscript, JSBool enable)
{
JSCompartment* oldCompartment;
JSBool rv;
oldCompartment = JS_EnterCompartmentOfScript(jsdc->dumbContext, jsdscript->script);
JSD_LOCK();
rv = JS_SetSingleStepMode(jsdc->dumbContext, jsdscript->script, enable);
JSD_UNLOCK();
JS_LeaveCompartment(jsdc->dumbContext, oldCompartment);
return rv;
}
开发者ID:RickEyre,项目名称:mozilla-central,代码行数:12,代码来源:jsd_scpt.cpp
示例4: jsd_ClearAllExecutionHooks
JSBool
jsd_ClearAllExecutionHooks(JSDContext* jsdc)
{
JSDScript* jsdscript;
JSDScript* iterp = NULL;
JSD_LOCK();
while( NULL != (jsdscript = jsd_IterateScripts(jsdc, &iterp)) )
jsd_ClearAllExecutionHooksForScript(jsdc, jsdscript);
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:RickEyre,项目名称:mozilla-central,代码行数:12,代码来源:jsd_scpt.cpp
示例5: jsd_SetDebuggerHook
bool
jsd_SetDebuggerHook(JSDContext* jsdc,
JSD_ExecutionHookProc hook,
void* callerdata)
{
JSD_LOCK();
jsdc->debuggerHookData = callerdata;
jsdc->debuggerHook = hook;
JSD_UNLOCK();
return true;
}
开发者ID:Incognito,项目名称:mozilla-central,代码行数:12,代码来源:jsd_hook.cpp
示例6: jsd_SetThrowHook
JSBool
jsd_SetThrowHook(JSDContext* jsdc,
JSD_ExecutionHookProc hook,
void* callerdata)
{
JSD_LOCK();
jsdc->throwHookData = callerdata;
jsdc->throwHook = hook;
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:SlateScience,项目名称:Spidermonkey,代码行数:12,代码来源:jsd_hook.cpp
示例7: jsd_SetFunctionHook
JSBool
jsd_SetFunctionHook(JSDContext* jsdc,
JSD_CallHookProc hook,
void* callerdata)
{
JSD_LOCK();
jsdc->functionHookData = callerdata;
jsdc->functionHook = hook;
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:SlateScience,项目名称:Spidermonkey,代码行数:12,代码来源:jsd_hook.cpp
示例8: jsd_SetTopLevelHook
JSBool
jsd_SetTopLevelHook(JSDContext* jsdc,
JSD_CallHookProc hook,
void* callerdata)
{
JSD_LOCK();
jsdc->toplevelHookData = callerdata;
jsdc->toplevelHook = hook;
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:SlateScience,项目名称:Spidermonkey,代码行数:12,代码来源:jsd_hook.cpp
示例9: jsd_GetErrorReporter
JSBool
jsd_GetErrorReporter(JSDContext* jsdc,
JSD_ErrorReporter* reporter,
void** callerdata)
{
JSD_LOCK();
if( reporter )
*reporter = jsdc->errorReporter;
if( callerdata )
*callerdata = jsdc->errorReporterData;
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:gitpan,项目名称:FreeWRL,代码行数:13,代码来源:jsd_high.c
示例10: jsd_SetInterruptHook
JSBool
jsd_SetInterruptHook(JSDContext* jsdc,
JSD_ExecutionHookProc hook,
void* callerdata)
{
JSD_LOCK();
jsdc->interruptHookData = callerdata;
jsdc->interruptHook = hook;
JS_SetInterrupt(jsdc->jsrt, jsd_InterruptHandler, (void*) jsdc);
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:SlateScience,项目名称:Spidermonkey,代码行数:13,代码来源:jsd_hook.cpp
示例11: jsd_EnableSingleStepInterrupts
JSBool
jsd_EnableSingleStepInterrupts(JSDContext* jsdc, JSDScript* jsdscript, JSBool enable)
{
JSCrossCompartmentCall *call;
JSBool rv;
call = JS_EnterCrossCompartmentCallScript(jsdc->dumbContext, jsdscript->script);
if(!call)
return JS_FALSE;
JSD_LOCK();
rv = JS_SetSingleStepMode(jsdc->dumbContext, jsdscript->script, enable);
JSD_UNLOCK();
JS_LeaveCrossCompartmentCall(call);
return rv;
}
开发者ID:marshall,项目名称:mozilla-central,代码行数:14,代码来源:jsd_scpt.c
示例12: jsd_DestroyScriptHookProc
void
jsd_DestroyScriptHookProc(
JSFreeOp *fop,
JSScript *script_,
void* callerdata )
{
JSDScript* jsdscript = NULL;
JSDContext* jsdc = (JSDContext*) callerdata;
JS::RootedScript script(jsdc->dumbContext, script_);
JSD_ScriptHookProc hook;
void* hookData;
JSD_ASSERT_VALID_CONTEXT(jsdc);
if( JSD_IS_DANGEROUS_THREAD(jsdc) )
return;
JSD_LOCK_SCRIPTS(jsdc);
jsdscript = jsd_FindJSDScript(jsdc, script);
JSD_UNLOCK_SCRIPTS(jsdc);
if( ! jsdscript )
return;
#ifdef JSD_DUMP
JSD_LOCK_SCRIPTS(jsdc);
_dumpJSDScript(jsdc, jsdscript, "***DESTROY Script: ");
JSD_UNLOCK_SCRIPTS(jsdc);
#endif /* JSD_DUMP */
/* local in case hook gets cleared on another thread */
JSD_LOCK();
hook = (jsdscript->flags & JSD_SCRIPT_CALL_DESTROY_HOOK_BIT) ? jsdc->scriptHook : NULL;
hookData = jsdc->scriptHookData;
JSD_UNLOCK();
if( hook )
hook(jsdc, jsdscript, JS_FALSE, hookData);
JSD_LOCK_SCRIPTS(jsdc);
JS_HashTableRemove(jsdc->scriptsTable, (void *)script);
JSD_UNLOCK_SCRIPTS(jsdc);
#ifdef JSD_DUMP
JSD_LOCK_SCRIPTS(jsdc);
_dumpJSDScriptList(jsdc);
JSD_UNLOCK_SCRIPTS(jsdc);
#endif /* JSD_DUMP */
}
开发者ID:RickEyre,项目名称:mozilla-central,代码行数:49,代码来源:jsd_scpt.cpp
示例13: jsd_NewScriptHookProc
void JS_DLL_CALLBACK
jsd_NewScriptHookProc(
JSContext *cx,
const char *filename, /* URL this script loads from */
uintN lineno, /* line where this script starts */
JSScript *script,
JSFunction *fun,
void* callerdata )
{
JSDScript* jsdscript = NULL;
JSDContext* jsdc = (JSDContext*) callerdata;
JSD_ScriptHookProc hook;
void* hookData;
JSD_ASSERT_VALID_CONTEXT(jsdc);
if( JSD_IS_DANGEROUS_THREAD(jsdc) )
return;
#ifdef LIVEWIRE
if( 1 == lineno )
jsdlw_PreLoadSource(jsdc, LWDBG_GetCurrentApp(), filename, JS_TRUE );
#endif
JSD_LOCK_SCRIPTS(jsdc);
jsdscript = _newJSDScript(jsdc, cx, script, fun);
JSD_UNLOCK_SCRIPTS(jsdc);
if( ! jsdscript )
return;
#ifdef JSD_DUMP
JSD_LOCK_SCRIPTS(jsdc);
_dumpJSDScript(jsdc, jsdscript, "***NEW Script: ");
_dumpJSDScriptList( jsdc );
JSD_UNLOCK_SCRIPTS(jsdc);
#endif /* JSD_DUMP */
/* local in case jsdc->scriptHook gets cleared on another thread */
JSD_LOCK();
hook = jsdc->scriptHook;
hookData = jsdc->scriptHookData;
JSD_UNLOCK();
if( hook )
hook(jsdc, jsdscript, JS_TRUE, hookData);
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:46,代码来源:jsd_scpt.c
示例14: jsd_NewScriptHookProc
void
jsd_NewScriptHookProc(
JSContext *cx,
const char *filename, /* URL this script loads from */
unsigned lineno, /* line where this script starts */
JSScript *script,
JSFunction *fun,
void* callerdata )
{
JSDScript* jsdscript = NULL;
JSDContext* jsdc = (JSDContext*) callerdata;
JSD_ScriptHookProc hook;
void* hookData;
JSD_ASSERT_VALID_CONTEXT(jsdc);
if( JSD_IS_DANGEROUS_THREAD(jsdc) )
return;
JSD_LOCK_SCRIPTS(jsdc);
jsdscript = _newJSDScript(jsdc, cx, script);
JSD_UNLOCK_SCRIPTS(jsdc);
if( ! jsdscript )
return;
#ifdef JSD_DUMP
JSD_LOCK_SCRIPTS(jsdc);
_dumpJSDScript(jsdc, jsdscript, "***NEW Script: ");
_dumpJSDScriptList( jsdc );
JSD_UNLOCK_SCRIPTS(jsdc);
#endif /* JSD_DUMP */
/* local in case jsdc->scriptHook gets cleared on another thread */
JSD_LOCK();
hook = jsdc->scriptHook;
if( hook )
jsdscript->flags = jsdscript->flags | JSD_SCRIPT_CALL_DESTROY_HOOK_BIT;
hookData = jsdc->scriptHookData;
JSD_UNLOCK();
if( hook )
hook(jsdc, jsdscript, JS_TRUE, hookData);
}
开发者ID:RickEyre,项目名称:mozilla-central,代码行数:43,代码来源:jsd_scpt.cpp
示例15: jsd_ClearAllExecutionHooksForScript
JSBool
jsd_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript)
{
JSDExecHook* jsdhook;
JSCList* list = &jsdscript->hooks;
JSD_LOCK();
while( (JSDExecHook*)list != (jsdhook = (JSDExecHook*)list->next) )
{
JS_REMOVE_LINK(&jsdhook->links);
free(jsdhook);
}
JS_ClearScriptTraps(jsdc->dumbContext, jsdscript->script);
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:19,代码来源:jsd_scpt.c
示例16: jsd_JSDContextForJSContext
JSDContext*
jsd_JSDContextForJSContext(JSContext* context)
{
JSDContext* iter;
JSDContext* jsdc = NULL;
JSD_LOCK();
for( iter = (JSDContext*)_jsd_context_list.next;
iter != (JSDContext*)&_jsd_context_list;
iter = (JSDContext*)iter->links.next )
{
if( PR_HashTableLookup(iter->jscontexts, context) )
{
jsdc = iter;
break;
}
}
JSD_UNLOCK();
return jsdc;
}
开发者ID:gitpan,项目名称:FreeWRL,代码行数:20,代码来源:jsd_high.c
示例17: jsd_ClearAllExecutionHooksForScript
JSBool
jsd_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript)
{
JSDExecHook* jsdhook;
JSCList* list = &jsdscript->hooks;
JSD_LOCK();
while( (JSDExecHook*)list != (jsdhook = (JSDExecHook*)list->next) )
{
JS_REMOVE_LINK(&jsdhook->links);
free(jsdhook);
}
/* No cross-compartment call here because we may be in the middle of GC */
JS_ClearScriptTraps(jsdc->dumbContext, jsdscript->script);
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:RickEyre,项目名称:mozilla-central,代码行数:20,代码来源:jsd_scpt.cpp
示例18: jsd_JSDContextForJSContext
JSDContext*
jsd_JSDContextForJSContext(JSContext* context)
{
JSDContext* iter;
JSDContext* jsdc = NULL;
JSRuntime* runtime = JS_GetRuntime(context);
JSD_LOCK();
for( iter = (JSDContext*)_jsd_context_list.next;
iter != (JSDContext*)&_jsd_context_list;
iter = (JSDContext*)iter->links.next )
{
if( runtime == iter->jsrt )
{
jsdc = iter;
break;
}
}
JSD_UNLOCK();
return jsdc;
}
开发者ID:Creativegame,项目名称:Spidermonkey,代码行数:21,代码来源:jsd_high.c
示例19: jsd_JSContextUsed
void
jsd_JSContextUsed(JSDContext* jsdc, JSContext* context)
{
JSDContextWrapper* wrapper;
PRHashEntry* he;
wrapper = _jsd_JSDContextWrapperForJSContext(jsdc, context);
if( wrapper )
{
/* error reporters are sometimes overwritten by other code... */
JSErrorReporter oldrep = JS_SetErrorReporter(context, jsd_ErrorReporter);
if( jsd_ErrorReporter != oldrep )
wrapper->originalErrorReporter = oldrep;
return;
}
/* else... */
wrapper = (JSDContextWrapper*) calloc(1,sizeof(JSDContextWrapper));
if( ! wrapper )
return;
JSD_LOCK();
he = PR_HashTableAdd(jsdc->jscontexts, context, wrapper);
JSD_UNLOCK();
if( ! he )
{
free(wrapper);
return;
}
wrapper->context = context;
wrapper->jsdc = jsdc;
/* add our error reporter */
wrapper->originalErrorReporter = JS_SetErrorReporter(context, jsd_ErrorReporter);
/* add our printer */
/* add our loader */
}
开发者ID:gitpan,项目名称:FreeWRL,代码行数:39,代码来源:jsd_high.c
示例20: jsd_InterruptHandler
JSTrapStatus
jsd_InterruptHandler(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,
void *closure)
{
JSDScript* jsdscript;
JSDContext* jsdc = (JSDContext*) closure;
JSD_ExecutionHookProc hook;
void* hookData;
if( ! jsdc || ! jsdc->inited )
return JSTRAP_CONTINUE;
if( JSD_IS_DANGEROUS_THREAD(jsdc) )
return JSTRAP_CONTINUE;
/* local in case jsdc->interruptHook gets cleared on another thread */
JSD_LOCK();
hook = jsdc->interruptHook;
hookData = jsdc->interruptHookData;
JSD_UNLOCK();
if (!hook)
return JSTRAP_CONTINUE;
JSD_LOCK_SCRIPTS(jsdc);
jsdscript = jsd_FindOrCreateJSDScript(jsdc, cx, script, JSNullFramePtr());
JSD_UNLOCK_SCRIPTS(jsdc);
if( ! jsdscript )
return JSTRAP_CONTINUE;
#ifdef LIVEWIRE
if( ! jsdlw_UserCodeAtPC(jsdc, jsdscript, (uintptr_t)pc) )
return JSTRAP_CONTINUE;
#endif
return jsd_CallExecutionHook(jsdc, cx, JSD_HOOK_INTERRUPTED,
hook, hookData, rval);
}
开发者ID:JSilver99,项目名称:mozilla-central,代码行数:38,代码来源:jsd_hook.cpp
注:本文中的JSD_UNLOCK函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论