z/OS xlc++ support changes#404
Conversation
| #define DYNAMIC_PROXY_JS_ERROR -4 | ||
|
|
||
| long v8ThreadId; | ||
| long v8ThreadIdWIN32; |
There was a problem hiding this comment.
Could this be replaced with
#ifdef WIN32
typedef long v8ThreadId;
#else
typedef pthread_t v8ThreadId;
#endif
and change the usages to use the new type v8ThreadId?
There was a problem hiding this comment.
Good catch, and great solution, although I don't believe xlc++ can handle the edit. I get the following error on compilation:
invalid operands to binary expression
('threadId' (aka 'pthread_t') and 'threadId')
if((isWIN32 && (myThreadId == v8ThreadId)) || (!isWIN32 && pthread_equal(myThreadId, v8ThreadId))) {
This is being thrown on:
myThreadId == v8ThreadId
even though it should have short circuited on the isWIN32 check
There was a problem hiding this comment.
I was hoping that by using the typedef you could get rid of a lot of the edits below. For example my_getThreadId could just be written:
v8ThreadId my_getThreadId() {
#ifdef WIN32
return GetCurrentThreadId();
#else
return pthread_self();
#endif
}
then we should be able to get rid of the isWIN32 logic all together.
If you want to use pthread_equal could #define v8ThreadIdEquals(a,b) ...
There was a problem hiding this comment.
I went ahead and took the logic out of the condition and put it into a function v8ThreadIdEquals instead. Everything is working perfectly for me on z/OS and OSX
|
wonderful thanks for the changes |
xlc++ on IBM z/OS does not support casting a pthread_t to a long. The following changes will fix the issue while still supporting other compilers.
Developed in consultation with @adnanhemani