This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: libgcj and the NPTL posix threads implementation


On Fri, 2004-02-27 at 09:23, Boehm, Hans wrote:
> I'm not quite sure what the best replacement is, though.  You were suggesting
> just using the segment register directly? 

I've been experimenting with the following patch, and it appears to work
just fine.  The only problem right now is that I'm not sure how to test
whether or not this is safe to use.

Any suggestions out there?

AG


Index: libjava/include/posix-threads.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/posix-threads.h,v
retrieving revision 1.25
diff -c -p -r1.25 posix-threads.h
*** libjava/include/posix-threads.h	21 Oct 2003 04:46:19 -0000	1.25
--- libjava/include/posix-threads.h	1 Mar 2004 05:45:19 -0000
*************** _Jv_ThreadCurrent (void)
*** 218,223 ****
--- 218,240 ----
  // to threads.
  
  
+ #ifdef __i386__
+ 
+ typedef size_t _Jv_ThreadId_t;
+ 
+ inline _Jv_ThreadId_t
+ _Jv_ThreadSelf (void)
+ {
+   size_t id;
+   asm ("mov %%gs:0x8, %0" : "=r"(id));
+   return id;
+ }
+ 
+ #define JV_SELF_DEFINED
+ 
+ #endif /* __i386__ */
+ 
+ 
  #ifdef __ia64__
  
  typedef size_t _Jv_ThreadId_t;



-- 
Anthony Green <green@redhat.com>
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]