File: config.joinable.m

package info (click to toggle)
gnustep-base 1.26.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 27,260 kB
  • sloc: objc: 204,878; ansic: 32,160; sh: 157; makefile: 128; cpp: 122; xml: 32
file content (19 lines) | stat: -rw-r--r-- 464 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Test whether Objective-C runtime uses pthreads and doesn't detach
 * them properly. If the join attempt succeeds, the thread was created
 * joinable (which it shouldn't be) and this program returns 0.
 */

#include "objc-common.g"
#include <pthread.h>

int
main()
{
  id            o = [NSObject new];
  pthread_t     tid;
  void          *value_ptr;

  tid = (pthread_t)objc_thread_detach (@selector(hash), o, nil);
  return pthread_join (tid, &value_ptr);
}