本文整理汇总了C++中JSD_LOCK函数的典型用法代码示例。如果您正苦于以下问题:C++ JSD_LOCK函数的具体用法?C++ JSD_LOCK怎么用?C++ JSD_LOCK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了JSD_LOCK函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: jsd_ClearInterruptHook
JSBool
jsd_ClearInterruptHook(JSDContext* jsdc)
{
JSD_LOCK();
JS_ClearInterrupt(jsdc->jsrt, NULL, NULL );
jsdc->interruptHook = NULL;
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:SlateScience,项目名称:Spidermonkey,代码行数:10,代码来源:jsd_hook.cpp
示例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_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:gitpan,项目名称:FreeWRL,代码行数:11,代码来源:jsd_high.c
示例4: 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
示例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_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
示例9: 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
示例10: 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
示例11: 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
示例12: jsd_SetExecutionHook
JSBool
jsd_SetExecutionHook(JSDContext* jsdc,
JSDScript* jsdscript,
jsuword pc,
JSD_ExecutionHookProc hook,
void* callerdata)
{
JSDExecHook* jsdhook;
JSD_LOCK();
if( ! hook )
{
jsd_ClearExecutionHook(jsdc, jsdscript, pc);
JSD_UNLOCK();
return JS_TRUE;
}
jsdhook = _findHook(jsdc, jsdscript, pc);
if( jsdhook )
{
jsdhook->hook = hook;
jsdhook->callerdata = callerdata;
JSD_UNLOCK();
return JS_TRUE;
}
/* else... */
jsdhook = (JSDExecHook*)calloc(1, sizeof(JSDExecHook));
if( ! jsdhook ) {
JSD_UNLOCK();
return JS_FALSE;
}
jsdhook->jsdscript = jsdscript;
jsdhook->pc = pc;
jsdhook->hook = hook;
jsdhook->callerdata = callerdata;
if( ! JS_SetTrap(jsdc->dumbContext, jsdscript->script,
(jsbytecode*)pc, jsd_TrapHandler,
(void*) PRIVATE_TO_JSVAL(jsdhook)) )
{
free(jsdhook);
JSD_UNLOCK();
return JS_FALSE;
}
JS_APPEND_LINK(&jsdhook->links, &jsdscript->hooks);
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:51,代码来源:jsd_scpt.c
示例13: 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
示例14: 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
示例15: jsd_TrapHandler
JSTrapStatus
jsd_TrapHandler(JSContext *cx, JSScript *script_, jsbytecode *pc, jsval *rval,
jsval closure)
{
JS::RootedScript script(cx, script_);
JSDExecHook* jsdhook = (JSDExecHook*) JSVAL_TO_PRIVATE(closure);
JSD_ExecutionHookProc hook;
void* hookData;
JSDContext* jsdc;
JSDScript* jsdscript;
JSD_LOCK();
if( NULL == (jsdc = jsd_JSDContextForJSContext(cx)) ||
! _isActiveHook(jsdc, script, jsdhook) )
{
JSD_UNLOCK();
return JSTRAP_CONTINUE;
}
JSD_ASSERT_VALID_EXEC_HOOK(jsdhook);
JS_ASSERT(!jsdhook->pc || jsdhook->pc == (uintptr_t)pc);
JS_ASSERT(jsdhook->jsdscript->script == script);
JS_ASSERT(jsdhook->jsdscript->jsdc == jsdc);
hook = jsdhook->hook;
hookData = jsdhook->callerdata;
jsdscript = jsdhook->jsdscript;
/* do not use jsdhook-> after this point */
JSD_UNLOCK();
if( ! jsdc || ! jsdc->inited )
return JSTRAP_CONTINUE;
if( JSD_IS_DANGEROUS_THREAD(jsdc) )
return JSTRAP_CONTINUE;
#ifdef LIVEWIRE
if( ! jsdlw_UserCodeAtPC(jsdc, jsdscript, (uintptr_t)pc) )
return JSTRAP_CONTINUE;
#endif
return jsd_CallExecutionHook(jsdc, cx, JSD_HOOK_BREAKPOINT,
hook, hookData, rval);
}
开发者ID:RickEyre,项目名称:mozilla-central,代码行数:46,代码来源:jsd_scpt.cpp
示例16: 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
示例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);
}
JS_ClearScriptTraps(jsdc->dumbContext, jsdscript->script);
JSD_UNLOCK();
return JS_TRUE;
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:19,代码来源:jsd_scpt.c
示例18: 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
示例19: 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
示例20: 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
注:本文中的JSD_LOCK函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论