thr_init.c (3f07b4bcbd9487f07b244731504e00e238da94d2) thr_init.c (7d9d7ca2ed3e3d630e63482c41f2d26194129c2c)
1/*
2 * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 144 unchanged lines hidden (view full) ---

153/*
154 * Threaded process initialization
155 */
156void
157_thread_init(void)
158{
159 struct pthread *pthread;
160 int fd;
1/*
2 * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 144 unchanged lines hidden (view full) ---

153/*
154 * Threaded process initialization
155 */
156void
157_thread_init(void)
158{
159 struct pthread *pthread;
160 int fd;
161 int flags;
162 int i;
163 size_t len;
164 int mib[2];
165 sigset_t set;
166
167 struct clockinfo clockinfo;
168 struct sigaction act;
169

--- 153 unchanged lines hidden (view full) ---

323 mib[1] = KERN_CLOCKRATE;
324 len = sizeof (struct clockinfo);
325 if (sysctl(mib, 2, &clockinfo, &len, NULL, 0) == 0)
326 _clock_res_usec = clockinfo.tick > CLOCK_RES_USEC_MIN ?
327 clockinfo.tick : CLOCK_RES_USEC_MIN;
328
329 /* Initialise the garbage collector mutex and condition variable. */
330 if (_pthread_mutex_init(&_gc_mutex,NULL) != 0 ||
161 int i;
162 size_t len;
163 int mib[2];
164 sigset_t set;
165
166 struct clockinfo clockinfo;
167 struct sigaction act;
168

--- 153 unchanged lines hidden (view full) ---

322 mib[1] = KERN_CLOCKRATE;
323 len = sizeof (struct clockinfo);
324 if (sysctl(mib, 2, &clockinfo, &len, NULL, 0) == 0)
325 _clock_res_usec = clockinfo.tick > CLOCK_RES_USEC_MIN ?
326 clockinfo.tick : CLOCK_RES_USEC_MIN;
327
328 /* Initialise the garbage collector mutex and condition variable. */
329 if (_pthread_mutex_init(&_gc_mutex,NULL) != 0 ||
331 pthread_cond_init(&_gc_cond,NULL) != 0)
330 _pthread_cond_init(&_gc_cond,NULL) != 0)
332 PANIC("Failed to initialise garbage collector mutex or condvar");
333}
334
335/*
336 * Special start up code for NetBSD/Alpha
337 */
338#if defined(__NetBSD__) && defined(__alpha__)
339int
340main(int argc, char *argv[], char *env);
341
342int
343_thread_main(int argc, char *argv[], char *env)
344{
345 _thread_init();
346 return (main(argc, argv, env));
347}
348#endif
331 PANIC("Failed to initialise garbage collector mutex or condvar");
332}
333
334/*
335 * Special start up code for NetBSD/Alpha
336 */
337#if defined(__NetBSD__) && defined(__alpha__)
338int
339main(int argc, char *argv[], char *env);
340
341int
342_thread_main(int argc, char *argv[], char *env)
343{
344 _thread_init();
345 return (main(argc, argv, env));
346}
347#endif