addl $1, total_seq(%ebx)
adcl $0, total_seq+4(%ebx)
+ addl $1, cond_futex(%ebx)
#define FRAME_SIZE 24
subl $FRAME_SIZE, %esp
21: movl %ecx, 4(%esp)
movl %edx, 8(%esp)
+ movl cond_futex(%ebx), %edi
+
/* Unlock. */
LOCK
#if cond_lock == 0
leal 4(%esp), %esi
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
movl %edi, %edx
- addl $wakeup_seq, %ebx
-.Ladd_wakeup:
+ addl $cond_futex, %ebx
+.Ladd_cond_futex:
movl $SYS_futex, %eax
ENTER_KERNEL
- subl $wakeup_seq, %ebx
-.Lsub_wakeup:
+ subl $cond_futex, %ebx
+.Lsub_cond_futex:
movl %eax, %esi
movl (%esp), %eax
addl $1, wakeup_seq(%ebx)
adcl $0, wakeup_seq+4(%ebx)
+ addl $1, cond_futex(%ebx)
movl $ETIMEDOUT, %esi
jmp 14f
.size __condvar_tw_cleanup3, .-__condvar_tw_cleanup3
.type __condvar_tw_cleanup2, @function
__condvar_tw_cleanup2:
- subl $wakeup_seq, %ebx
+ subl $cond_futex, %ebx
.size __condvar_tw_cleanup2, .-__condvar_tw_cleanup2
.type __condvar_tw_cleanup, @function
__condvar_tw_cleanup:
call __lll_mutex_lock_wait
1: movl broadcast_seq(%ebx), %eax
- cmpl 12(%esp), %eax
+ cmpl 20(%esp), %eax
jne 3f
addl $1, wakeup_seq(%ebx)
adcl $0, wakeup_seq+4(%ebx)
+ addl $1, cond_futex(%ebx)
+
addl $1, woken_seq(%ebx)
adcl $0, woken_seq+4(%ebx)
call __lll_mutex_unlock_wake
/* Wake up all waiters to make sure no signal gets lost. */
-2: addl $wakeup_seq, %ebx
+2: addl $cond_futex, %ebx
movl $FUTEX_WAKE, %ecx
movl $SYS_futex, %eax
movl $0x7fffffff, %edx
.uleb128 .Lcstend-.Lcstbegin
.Lcstbegin:
.long .LcleanupSTART-.LSTARTCODE
- .long .Ladd_wakeup-.LcleanupSTART
+ .long .Ladd_cond_futex-.LcleanupSTART
.long __condvar_tw_cleanup-.LSTARTCODE
.uleb128 0
.long .LebxmovedUR-.LSTARTCODE
.long __condvar_tw_cleanup3-.LSTARTCODE
.uleb128 0
.long .LebxmovedUR-.LSTARTCODE
- .long .Ladd_wakeup-.LebxmovedUR
+ .long .Ladd_cond_futex-.LebxmovedUR
.long __condvar_tw_cleanup-.LSTARTCODE
.uleb128 0
- .long .Ladd_wakeup-.LSTARTCODE
- .long .Lsub_wakeup-.Ladd_wakeup
+ .long .Ladd_cond_futex-.LSTARTCODE
+ .long .Lsub_cond_futex-.Ladd_cond_futex
.long __condvar_tw_cleanup2-.LSTARTCODE
.uleb128 0
- .long .Lsub_wakeup-.LSTARTCODE
- .long .LcleanupEND-.Lsub_wakeup
+ .long .Lsub_cond_futex-.LSTARTCODE
+ .long .LcleanupEND-.Lsub_cond_futex
.long __condvar_tw_cleanup-.LSTARTCODE
.uleb128 0
.long .LcallUR-.LSTARTCODE