Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[BZ #163]
Update.
2004-05-18  Petter Reinholdtsen  <pere@hungry.com>

	* locales/sl_SI [LC_TIME]: Correct d_fmt date format from
	'22.06.2003' to '22. 06. 2003'.  Change requested from Aleks
	Reinhardt, and approved by the locale author Borka
	Jerman-Blazic. [BZ #163]
  • Loading branch information
Ulrich Drepper committed May 18, 2004
1 parent d40eb37 commit 893a351
Show file tree
Hide file tree
Showing 27 changed files with 450 additions and 50 deletions.
7 changes: 7 additions & 0 deletions localedata/ChangeLog
@@ -1,3 +1,10 @@
2004-05-18 Petter Reinholdtsen <pere@hungry.com>

* locales/sl_SI [LC_TIME]: Correct d_fmt date format from
'22.06.2003' to '22. 06. 2003'. Change requested from Aleks
Reinhardt, and approved by the locale author Borka
Jerman-Blazic. [BZ #163]

2004-05-17 Ulrich Drepper <drepper@redhat.com>

* SUPPORTED (SUPPORTED-LOCALES): Remove sr_YU locales.
Expand Down
2 changes: 1 addition & 1 deletion localedata/locales/sl_SI
Expand Up @@ -2176,7 +2176,7 @@ mon "<U006A><U0061><U006E><U0075><U0061><U0072>";/
"<U006E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
"<U0064><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
d_fmt "<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0059>"
d_fmt "<U0025><U0064><U002E><U0020><U0025><U006D><U002E><U0020><U0025><U0059>"
t_fmt "<U0025><U0054>"
am_pm "";""
t_fmt_ampm ""
Expand Down
2 changes: 1 addition & 1 deletion malloc/mtrace.pl
Expand Up @@ -30,7 +30,7 @@ sub usage {
print " --help print this help, then exit\n";
print " --version print version number, then exit\n";
print "\n";
print "For bug reporting instructions, please see:\n"
print "For bug reporting instructions, please see:\n";
print "<http://www.gnu.org/software/libc/bugs.html>.\n";
exit 0;
}
Expand Down
45 changes: 45 additions & 0 deletions nptl/ChangeLog
@@ -1,3 +1,48 @@
2004-05-18 Jakub Jelinek <jakub@redhat.com>

* Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
compilation.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
(__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
(pthread_cond_t): Add __data.__broadcast_seq field.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
(FRAME_SIZE): Define.
(__pthread_cond_timedwait): Use it. Store/check broadcast_seq.
Comment typo fixes.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
Define.
(__pthread_cond_wait): Use it. Store/check broadcast_seq. Comment
typo fixes.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
(__pthread_cond_broadcast): Increment broadcast_seq. Comment typo
fixes.

2004-05-18 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
* sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
Add __broadcast_seq field.
* sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
all waiters as woken with woken_seq and bump broadcast counter.
* sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
__broadcast_seq field.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* sysdeps/pthread/pthread_cond_wait.c: Likewise.
* sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
* pthread_cond_init.c: Initialize __broadcast_seq field.
* Makefile (tests): Add tst-cond17 and tst-cond18.
Add .NOTPARALLEL goal.
* tst-cond16.c: New file. From Jakub.
* tst-cond17.c: New file. From Jakub.
* tst-cond18.c: New file. From Jakub.

2004-05-16 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
Expand Down
30 changes: 26 additions & 4 deletions nptl/DESIGN-condvar.txt
Expand Up @@ -23,16 +23,30 @@ struct pthread_cond_t {

sequence number of last woken thread.

uint32_t broadcast_seq;

}


struct cv_data {

pthread_cond_t *cv;

uint32_t bc_seq

}



cleanup_handler(cv)
cleanup_handler(cv_data)
{
cv = cv_data->cv;
lll_lock(cv->lock);

++cv->wakeup_seq;
++cv->woken_seq;
if (cv_data->bc_seq == cv->broadcast_seq) {
++cv->wakeup_seq;
++cv->woken_seq;
}

/* make sure no signal gets lost. */
FUTEX_WAKE(cv->wakeup_seq, ALL);
Expand All @@ -50,19 +64,24 @@ cond_timedwait(cv, mutex, timeout):

++cv->total_seq;
val = seq = cv->wakeup_seq;
cv_data.bc = cv->broadcast_seq;
cv_data.cv = cv;

while (1) {

lll_unlock(cv->lock);

enable_async
enable_async(&cv_data);

ret = FUTEX_WAIT(cv->wakeup_seq, val, timeout);

restore_async

lll_lock(cv->lock);

if (bc != cv->broadcast_seq)
goto bc_out;

val = cv->wakeup_seq;

if (val != seq && cv->woken_seq != val) {
Expand All @@ -78,6 +97,7 @@ cond_timedwait(cv, mutex, timeout):

++cv->woken_seq;

bc_out:
lll_unlock(cv->lock);

cleanup_pop
Expand Down Expand Up @@ -105,6 +125,8 @@ cond_broadcast(cv)

if (cv->total_seq > cv->wakeup_seq) {
cv->wakeup_seq = cv->total_seq;
cv->woken_seq = cv->total_seq;
++cv->broadcast_seq;
FUTEX_WAKE(cv->wakeup_seq, ALL);
}

Expand Down
7 changes: 6 additions & 1 deletion nptl/Makefile
Expand Up @@ -194,7 +194,7 @@ tests = tst-attr1 tst-attr2 tst-attr3 \
tst-spin1 tst-spin2 tst-spin3 \
tst-cond1 tst-cond2 tst-cond3 tst-cond4 tst-cond5 tst-cond6 tst-cond7 \
tst-cond8 tst-cond9 tst-cond10 tst-cond11 tst-cond12 tst-cond13 \
tst-cond14 tst-cond15 \
tst-cond14 tst-cond15 tst-cond17 tst-cond18 \
tst-rwlock1 tst-rwlock2 tst-rwlock3 tst-rwlock4 tst-rwlock5 \
tst-rwlock6 tst-rwlock7 tst-rwlock8 tst-rwlock9 tst-rwlock10 \
tst-rwlock11 tst-rwlock12 tst-rwlock13 \
Expand Down Expand Up @@ -576,3 +576,8 @@ tst-exec4-ARGS = $(built-program-cmd)
$(objpfx)tst-execstack: $(libdl)
$(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so
LDFLAGS-tst-execstack = -Wl,-z,noexecstack

# The tests here better do not run in parallel
ifneq ($(filter %tests,$(MAKECMDGOALS)),)
.NOTPARALLEL:
endif
3 changes: 2 additions & 1 deletion nptl/pthread_cond_init.c
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
Expand Down Expand Up @@ -38,6 +38,7 @@ __pthread_cond_init (cond, cond_attr)
cond->__data.__woken_seq = 0;
cond->__data.__mutex = (icond_attr == NULL || (icond_attr->value & 1) == 0
? NULL : (void *) ~0l);
cond->__data.__broadcast_seq = 0;

return 0;
}
Expand Down
5 changes: 4 additions & 1 deletion nptl/sysdeps/pthread/pthread_cond_broadcast.c
@@ -1,4 +1,4 @@
/* Copyright (C) 2003 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
Expand Down Expand Up @@ -40,6 +40,9 @@ __pthread_cond_broadcast (cond)
{
/* Yes. Mark them all as woken. */
cond->__data.__wakeup_seq = cond->__data.__total_seq;
cond->__data.__woken_seq = cond->__data.__total_seq;
/* Signal that a broadcast happened. */
++cond->__data.__broadcast_seq;

/* We are done. */
lll_mutex_unlock (cond->__data.__lock);
Expand Down
15 changes: 14 additions & 1 deletion nptl/sysdeps/pthread/pthread_cond_timedwait.c
Expand Up @@ -36,6 +36,7 @@ struct _condvar_cleanup_buffer
int oldtype;
pthread_cond_t *cond;
pthread_mutex_t *mutex;
unsigned int bc_seq;
};

int
Expand Down Expand Up @@ -85,6 +86,8 @@ __pthread_cond_timedwait (cond, mutex, abstime)
unsigned long long int val;
unsigned long long int seq;
val = seq = cond->__data.__wakeup_seq;
/* Remember the broadcast counter. */
cbuffer.bc_seq = cond->__data.__broadcast_seq;

/* The futex syscall operates on a 32-bit word. That is fine, we
just use the low 32 bits of the sequence counter. */
Expand Down Expand Up @@ -139,7 +142,12 @@ __pthread_cond_timedwait (cond, mutex, abstime)
}
/* Did we already time out? */
if (__builtin_expect (rt.tv_sec < 0, 0))
goto timeout;
{
if (cbuffer.bc_seq != cond->__data.__broadcast_seq)
goto bc_out;

goto timeout;
}

/* Prepare to wait. Release the condvar futex. */
lll_mutex_unlock (cond->__data.__lock);
Expand All @@ -157,6 +165,10 @@ __pthread_cond_timedwait (cond, mutex, abstime)
/* We are going to look at shared data again, so get the lock. */
lll_mutex_lock(cond->__data.__lock);

/* If a broadcast happened, we are done. */
if (cbuffer.bc_seq != cond->__data.__broadcast_seq)
goto bc_out;

/* Check whether we are eligible for wakeup. */
val = cond->__data.__wakeup_seq;
if (val != seq && cond->__data.__woken_seq != val)
Expand All @@ -178,6 +190,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
/* Another thread woken up. */
++cond->__data.__woken_seq;

bc_out:
/* We are done with the condvar. */
lll_mutex_unlock (cond->__data.__lock);

Expand Down
19 changes: 15 additions & 4 deletions nptl/sysdeps/pthread/pthread_cond_wait.c
Expand Up @@ -32,6 +32,7 @@ struct _condvar_cleanup_buffer
int oldtype;
pthread_cond_t *cond;
pthread_mutex_t *mutex;
unsigned int bc_seq;
};


Expand All @@ -45,10 +46,13 @@ __condvar_cleanup (void *arg)
/* We are going to modify shared data. */
lll_mutex_lock (cbuffer->cond->__data.__lock);

/* This thread is not waiting anymore. Adjust the sequence counters
appropriately. */
++cbuffer->cond->__data.__wakeup_seq;
++cbuffer->cond->__data.__woken_seq;
if (cbuffer->bc_seq == cbuffer->cond->__data.__broadcast_seq)
{
/* This thread is not waiting anymore. Adjust the sequence counters
appropriately. */
++cbuffer->cond->__data.__wakeup_seq;
++cbuffer->cond->__data.__woken_seq;
}

/* We are done. */
lll_mutex_unlock (cbuffer->cond->__data.__lock);
Expand Down Expand Up @@ -111,6 +115,8 @@ __pthread_cond_wait (cond, mutex)
unsigned long long int val;
unsigned long long int seq;
val = seq = cond->__data.__wakeup_seq;
/* Remember the broadcast counter. */
cbuffer.bc_seq = cond->__data.__broadcast_seq;

/* The futex syscall operates on a 32-bit word. That is fine, we
just use the low 32 bits of the sequence counter. */
Expand All @@ -137,6 +143,10 @@ __pthread_cond_wait (cond, mutex)
/* Disable asynchronous cancellation. */
__pthread_disable_asynccancel (cbuffer.oldtype);

/* If a broadcast happened, we are done. */
if (cbuffer.bc_seq != cond->__data.__broadcast_seq)
goto bc_out;

/* We are going to look at shared data again, so get the lock. */
lll_mutex_lock (cond->__data.__lock);

Expand All @@ -148,6 +158,7 @@ __pthread_cond_wait (cond, mutex)
/* Another thread woken up. */
++cond->__data.__woken_seq;

bc_out:
/* We are done with the condvar. */
lll_mutex_unlock (cond->__data.__lock);

Expand Down
1 change: 1 addition & 0 deletions nptl/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
Expand Up @@ -81,6 +81,7 @@ typedef union
unsigned long long int __wakeup_seq;
unsigned long long int __woken_seq;
void *__mutex;
unsigned int __broadcast_seq;
} __data;
char __size[__SIZEOF_PTHREAD_COND_T];
long long int __align;
Expand Down
1 change: 1 addition & 0 deletions nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
Expand Up @@ -81,6 +81,7 @@ typedef union
unsigned long long int __wakeup_seq;
unsigned long long int __woken_seq;
void *__mutex;
unsigned int __broadcast_seq;
} __data;
char __size[__SIZEOF_PTHREAD_COND_T];
long long int __align;
Expand Down
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
Expand Down Expand Up @@ -74,6 +74,9 @@ __pthread_cond_broadcast:
woken up. */
3: movl %ecx, (%ebx)
movl %eax, 4(%ebx)
movl %ecx, woken_seq-wakeup_seq(%ebx)
movl %eax, woken_seq-wakeup_seq+4(%ebx)
addl $1, broadcast_seq-wakeup_seq(%ebx)

/* Get the address of the mutex used. */
movl dep_mutex-wakeup_seq(%ebx), %edi
Expand Down

0 comments on commit 893a351

Please sign in to comment.