Ignore:
Timestamp:
Jan 27, 2007, 6:58:47 PM (18 years ago)
Author:
ggaren
Message:

Reviewed by Beth Dakin.


Added some missing JSLocks, which might fix <rdar://problem/4889707>.

We need to lock whenever we might allocate memory because our FastMalloc
implementation requires clients to register their threads, which we do
through JSLock.


We also need to lock whenever modifying ref-counts because they're not
thread-safe.

  • API/JSObjectRef.cpp: (JSClassCreate): Allocates memory (JSClassRetain): Modifies a ref-count (JSClassRelease): Modifies a ref-count (JSPropertyNameArrayRetain): Modifies a ref-count (JSPropertyNameArrayRelease): Modifies a ref-count
  • API/JSStringRef.cpp: (JSStringRetain): Modifies a ref-count
  • API/JSValueRef.cpp: (JSValueIsInstanceOfConstructor): Might allocate memory if an exception is thrown.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSValueRef.cpp

    r16371 r19193  
    141141bool JSValueIsInstanceOfConstructor(JSContextRef ctx, JSValueRef value, JSObjectRef constructor, JSValueRef* exception)
    142142{
     143    JSLock lock;
    143144    ExecState* exec = toJS(ctx);
    144145    JSValue* jsValue = toJS(value);
Note: See TracChangeset for help on using the changeset viewer.