backout 7b4c94293707 (bug 686230)

This commit is contained in:
Steve Fink 2011-09-26 17:06:15 -07:00
parent 2742deb964
commit 538fc70e92
4 changed files with 0 additions and 43 deletions

View File

@ -1696,17 +1696,6 @@ extern JS_PUBLIC_DATA(jsid) JSID_EMPTY;
*/
#define JSFUN_GENERIC_NATIVE JSFUN_LAMBDA
/*
* The first call to JS_CallOnce by any thread in a process will call 'func'.
* Later calls to JS_CallOnce with the same JSCallOnceType object will be
* suppressed.
*
* Equivalently: each distinct JSCallOnceType object will allow one JS_CallOnce
* to invoke its JSInitCallback.
*/
extern JS_PUBLIC_API(JSBool)
JS_CallOnce(JSCallOnceType *once, JSInitCallback func);
/*
* Microseconds since the epoch, midnight, January 1, 1970 UTC. See the
* comment in jstypes.h regarding safe int64 usage.

View File

@ -739,28 +739,4 @@ js_IsRuntimeLocked(JSRuntime *rt)
return js_CurrentThreadId() == rt->rtLockOwner;
}
#endif /* DEBUG */
static PRStatus
CallOnce(void *func)
{
JSInitCallback init = JS_DATA_TO_FUNC_PTR(JSInitCallback, func);
return init() ? PR_FAILURE : PR_SUCCESS;
}
JS_PUBLIC_API(JSBool)
JS_CallOnce(JSCallOnceType *once, JSInitCallback func)
{
return PR_CallOnceWithArg(once, CallOnce, JS_FUNC_TO_DATA_PTR(void *, func)) == PR_SUCCESS;
}
#else /* JS_THREADSAFE */
JS_PUBLIC_API(JSBool)
JS_CallOnce(JSCallOnceType *once, JSInitCallback func)
{
if (!*once) {
*once = true;
return func();
} else {
return JS_TRUE;
}
}
#endif /* JS_THREADSAFE */

View File

@ -48,7 +48,6 @@
# include "prlock.h"
# include "prcvar.h"
# include "prthread.h"
# include "prinit.h"
#endif
#ifdef JS_THREADSAFE

View File

@ -241,13 +241,6 @@ typedef struct JSFlatString JSFlatString;
typedef struct JSString JSString;
#endif
#ifdef JS_THREADSAFE
typedef struct PRCallOnceType JSCallOnceType;
#else
typedef JSBool JSCallOnceType;
#endif
typedef JSBool (*JSInitCallback)(void);
JS_END_EXTERN_C
#endif /* jspubtd_h___ */