Mercurial > sdl-ios-xcode
comparison test/testhread.c @ 3578:0d1b16ee0bca
Fixed bug #741
The thread ID is an unsigned long so it can hold pthread_t so people can do naughty things with it.
I'm going to be adding additional useful thread API functions, but this should prevent crashes in people's existing code on 64-bit architectures.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 16 Dec 2009 04:48:11 +0000 |
parents | 4436464c4f51 |
children |
comparison
equal
deleted
inserted
replaced
3577:72024425b437 | 3578:0d1b16ee0bca |
---|---|
19 } | 19 } |
20 | 20 |
21 int SDLCALL | 21 int SDLCALL |
22 ThreadFunc(void *data) | 22 ThreadFunc(void *data) |
23 { | 23 { |
24 printf("Started thread %s: My thread id is %u\n", | 24 printf("Started thread %s: My thread id is %lu\n", |
25 (char *) data, SDL_ThreadID()); | 25 (char *) data, SDL_ThreadID()); |
26 while (alive) { | 26 while (alive) { |
27 printf("Thread '%s' is alive!\n", (char *) data); | 27 printf("Thread '%s' is alive!\n", (char *) data); |
28 SDL_Delay(1 * 1000); | 28 SDL_Delay(1 * 1000); |
29 } | 29 } |