[vmkit-commits] [PATCH] OpenJDK.inc: Implement raw monitors

Will Dietz wdietz2 at illinois.edu
Thu Oct 27 10:39:58 PDT 2011


On Thu, Oct 27, 2011 at 11:59 AM, Nicolas Geoffray
<nicolas.geoffray at gmail.com> wrote:
>>  typedef pthread_mutex_t Lock;

typedef for convenience, when wrote this didn't realize "Lock" was
used elsewhere.

Per your comment below, will use pthread_mutex_t to be clearer.

>>  JNIEXPORT void * JNICALL
>>  JVM_RawMonitorCreate(void) {
>> -  NYI();
>> +  BEGIN_JNI_EXCEPTION
>> +  mvm::ThreadAllocator allocator;
>
> Remove the allocator.
>

Will do, not sure how that snuck in there.

>>
>> +  Lock* L = (Lock*)malloc(sizeof(Lock));
>
> Why a Lock? Could that just be a pthread_mutex_t? Plus, the way you're using
> it below is quite scary if you say it's a Lock :)
>>
>> +  pthread_mutex_init(L, NULL);
>> +

~Will




More information about the vmkit-commits mailing list