ftp.nice.ch/Attic/openStep/developer/bundles/GDBbundle.1.0.s.tgz#/GDBbundle-1.0.s/debug/gdb/gdb/tests/threadTest.c

This is threadTest.c in view mode; [Download] [Up]

#import <mach/cthreads.h>

static void tellDebuggerNotToSuspend()
{
}

static int foo(int dummy)
{
    tellDebuggerNotToSuspend();
    while (1) {
	sleep(1);
	printf("In exc thread.\n");
    }
    return 1;
}

void main()
{
    cthread_detach(cthread_fork(foo, 0));
    while (1) {
	sleep(1);
	printf("In main thread.\n");
    }
}
    

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.