mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
The test pth_detached3 will crash on MIPS platform if the value passed to pthread_detach is not correctly aligned. Thus, we change the value to be still invalid but aligned. This fixes the failure of drd/tests/pth_detached3 on MIPS32. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13191
30 lines
566 B
C
30 lines
566 B
C
/* Invoke pthread_detach() with an invalid thread ID. */
|
|
|
|
#include <assert.h>
|
|
#include <errno.h>
|
|
#include <pthread.h>
|
|
#include <stdio.h>
|
|
|
|
static void* thread_func(void* arg)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
pthread_t thread;
|
|
|
|
pthread_create(&thread, NULL, thread_func, NULL);
|
|
pthread_join(thread, NULL);
|
|
|
|
/* Invoke pthread_detach() with the thread ID of a joined thread. */
|
|
pthread_detach(thread);
|
|
|
|
/* Invoke pthread_detach() with an invalid thread ID. */
|
|
pthread_detach(thread + 8);
|
|
|
|
fprintf(stderr, "Finished.\n");
|
|
|
|
return 0;
|
|
}
|