[PATCH?] Separate pthread patches, #2 take 1 redux

Dave Korn dave.korn.cygwin@googlemail.com
Wed Jun 3 23:41:00 GMT 2009


Dave Korn wrote:
> Dave Korn wrote:
>>   The attached patch implements ilockexch and ilockcmpexch, using the inline
>> asm definition from __arch_compare_and_exchange_val_32_acq in
>> glibc-2.10.1/sysdeps/i386/i486/bits/atomic.h, trivially expanded inline rather
>> than in its original preprocessor macro form.

  And this one, just to have the full set in the same place, is the version
that I originally suggested.  It generates correct and efficient code:

L215:
	.loc 3 127 0
	movl	__ZN13pthread_mutex7mutexesE+8, %eax	 # mutexes.head, D.28638
	movl	%eax, 36(%ebx)	 # D.28638, <variable>.next
	.loc 2 53 0
/APP
 # 53 "/gnu/winsup/src/winsup/cygwin/winbase.h" 1
	
	lock cmpxchgl %ebx,__ZN13pthread_mutex7mutexesE+8	 # this,
	
 # 0 "" 2
/NO_APP
	.loc 3 126 0
	cmpl	%eax, 36(%ebx)	 # D.28635, <variable>.next
	jne	L215	 #,

but is more risky.  No ChangeLog because it's not going to be approved, I'm
posting it just for completeness and future reference.

    cheers,
      DaveK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pthread-interlocked-asms-v1.diff
Type: text/x-c
Size: 1129 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20090603/0bfa0f6e/attachment.bin>


More information about the Cygwin-patches mailing list