mirror of git://sourceware.org/git/glibc.git
Update.
* Makefile (tests): Comment out tst-cancel for now.
This commit is contained in:
parent
7d4c3e67b4
commit
9dd7309cee
|
|
@ -1,5 +1,7 @@
|
||||||
2001-04-11 Ulrich Drepper <drepper@redhat.com>
|
2001-04-11 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* Makefile (tests): Comment out tst-cancel for now.
|
||||||
|
|
||||||
* tst-cancel.c (main): Cleanup 4 is supposed to run. Create
|
* tst-cancel.c (main): Cleanup 4 is supposed to run. Create
|
||||||
temporary file in object directory.
|
temporary file in object directory.
|
||||||
* Makefile: Don't allow inlining when compiling tst-cancel.c.
|
* Makefile: Don't allow inlining when compiling tst-cancel.c.
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ endif
|
||||||
librt-tests = ex10 ex11
|
librt-tests = ex10 ex11
|
||||||
tests = ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 $(librt-tests) ex12 ex13 joinrace \
|
tests = ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 $(librt-tests) ex12 ex13 joinrace \
|
||||||
tststack $(tests-nodelete-$(have-z-nodelete)) ecmutex ex14 ex15 ex16 \
|
tststack $(tests-nodelete-$(have-z-nodelete)) ecmutex ex14 ex15 ex16 \
|
||||||
ex17 tst-cancel
|
ex17 #tst-cancel
|
||||||
|
|
||||||
ifeq (yes,$(build-shared))
|
ifeq (yes,$(build-shared))
|
||||||
tests-nodelete-yes = unload
|
tests-nodelete-yes = unload
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,14 @@
|
||||||
#include "restart.h"
|
#include "restart.h"
|
||||||
#include <stackinfo.h>
|
#include <stackinfo.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#ifdef _STACK_GROWS_DOWN
|
||||||
|
# define FRAME_LEFT(frame, other) ((char *) frame >= (char *) other)
|
||||||
|
#elif _STACK_GROWS_UP
|
||||||
|
# define FRAME_LEFT(frame, other) ((char *) frame <= (char *) other)
|
||||||
|
#else
|
||||||
|
# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
int pthread_setcancelstate(int state, int * oldstate)
|
int pthread_setcancelstate(int state, int * oldstate)
|
||||||
{
|
{
|
||||||
|
|
@ -125,18 +132,8 @@ void _pthread_cleanup_push(struct _pthread_cleanup_buffer * buffer,
|
||||||
buffer->__routine = routine;
|
buffer->__routine = routine;
|
||||||
buffer->__arg = arg;
|
buffer->__arg = arg;
|
||||||
buffer->__prev = THREAD_GETMEM(self, p_cleanup);
|
buffer->__prev = THREAD_GETMEM(self, p_cleanup);
|
||||||
if (buffer->__prev != NULL)
|
if (buffer->__prev != NULL && FRAME_LEFT (buffer, buffer->__prev))
|
||||||
{
|
buffer->__prev = NULL;
|
||||||
#if _STACK_GROWS_DOWN
|
|
||||||
if ((char *) buffer >= (char *) buffer->__prev)
|
|
||||||
buffer->__prev = NULL;
|
|
||||||
#elif _STACK_GROWS_UP
|
|
||||||
if ((char *) buffer <= (char *) buffer->__prev)
|
|
||||||
buffer->__prev = NULL;
|
|
||||||
#else
|
|
||||||
# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
THREAD_SETMEM(self, p_cleanup, buffer);
|
THREAD_SETMEM(self, p_cleanup, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -156,16 +153,8 @@ void _pthread_cleanup_push_defer(struct _pthread_cleanup_buffer * buffer,
|
||||||
buffer->__arg = arg;
|
buffer->__arg = arg;
|
||||||
buffer->__canceltype = THREAD_GETMEM(self, p_canceltype);
|
buffer->__canceltype = THREAD_GETMEM(self, p_canceltype);
|
||||||
buffer->__prev = THREAD_GETMEM(self, p_cleanup);
|
buffer->__prev = THREAD_GETMEM(self, p_cleanup);
|
||||||
if (buffer->__prev != NULL)
|
if (buffer->__prev != NULL && FRAME_LEFT (buffer, buffer->__prev))
|
||||||
{
|
buffer->__prev = NULL;
|
||||||
#if _STACK_GROWS_DOWN
|
|
||||||
if ((char *) buffer >= (char *) buffer->__prev)
|
|
||||||
buffer->__prev = NULL;
|
|
||||||
#elif _STACK_GROWS_UP
|
|
||||||
if ((char *) buffer <= (char *) buffer->__prev)
|
|
||||||
buffer->__prev = NULL;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
THREAD_SETMEM(self, p_canceltype, PTHREAD_CANCEL_DEFERRED);
|
THREAD_SETMEM(self, p_canceltype, PTHREAD_CANCEL_DEFERRED);
|
||||||
THREAD_SETMEM(self, p_cleanup, buffer);
|
THREAD_SETMEM(self, p_cleanup, buffer);
|
||||||
}
|
}
|
||||||
|
|
@ -186,18 +175,30 @@ void _pthread_cleanup_pop_restore(struct _pthread_cleanup_buffer * buffer,
|
||||||
void __pthread_perform_cleanup(char *currentframe)
|
void __pthread_perform_cleanup(char *currentframe)
|
||||||
{
|
{
|
||||||
pthread_descr self = thread_self();
|
pthread_descr self = thread_self();
|
||||||
struct _pthread_cleanup_buffer * c;
|
struct _pthread_cleanup_buffer *c = THREAD_GETMEM(self, p_cleanup);
|
||||||
|
struct _pthread_cleanup_buffer *last;
|
||||||
|
|
||||||
for (c = THREAD_GETMEM(self, p_cleanup); c != NULL; c = c->__prev)
|
if (c != NULL)
|
||||||
|
while (FRAME_LEFT (currentframe, c))
|
||||||
|
{
|
||||||
|
last = c;
|
||||||
|
c = c->__prev;
|
||||||
|
|
||||||
|
if (c == NULL || FRAME_LEFT (last, c))
|
||||||
|
{
|
||||||
|
c = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (c != NULL)
|
||||||
{
|
{
|
||||||
#if _STACK_GROWS_DOWN
|
|
||||||
if ((char *) c <= currentframe)
|
|
||||||
break;
|
|
||||||
#elif _STACK_GROWS_UP
|
|
||||||
if ((char *) c >= currentframe)
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
c->__routine(c->__arg);
|
c->__routine(c->__arg);
|
||||||
|
|
||||||
|
last = c;
|
||||||
|
c = c->__prev;
|
||||||
|
if (! FRAME_LEFT (last, c))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* And the TSD which needs special help. */
|
/* And the TSD which needs special help. */
|
||||||
|
|
|
||||||
|
|
@ -25,15 +25,6 @@ cleanup (void *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
volatile int cleanupokcnt;
|
|
||||||
|
|
||||||
static void
|
|
||||||
cleanupok (void *arg)
|
|
||||||
{
|
|
||||||
++cleanupokcnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
t1 (void *arg)
|
t1 (void *arg)
|
||||||
{
|
{
|
||||||
|
|
@ -63,6 +54,16 @@ t2 (void *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* This does not work yet. */
|
||||||
|
volatile int cleanupokcnt;
|
||||||
|
|
||||||
|
static void
|
||||||
|
cleanupok (void *arg)
|
||||||
|
{
|
||||||
|
++cleanupokcnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
innerok (int a)
|
innerok (int a)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue