Changeset 13455
- Timestamp:
- Feb 22, 2010, 10:43:56 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/source/lisp-kernel/thread_manager.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lisp-kernel/thread_manager.c
r13434 r13455 1610 1610 count_cpus() 1611 1611 { 1612 #ifdef DARWIN1613 /* As of OSX 10.4, Darwin doesn't define _SC_NPROCESSORS_ONLN */1614 #include <mach/host_info.h>1615 1616 struct host_basic_info info;1617 mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT;1618 1619 if (KERN_SUCCESS == host_info(mach_host_self(), HOST_BASIC_INFO,(host_info_t)(&info),&count)) {1620 if (info.max_cpus > 1) {1621 spin_lock_tries = 1024;1622 }1623 }1624 #else1625 1612 int n = sysconf(_SC_NPROCESSORS_ONLN); 1626 1613 … … 1628 1615 spin_lock_tries = 1024; 1629 1616 } 1630 #endif1631 1617 } 1632 1618 #endif … … 1852 1838 #else 1853 1839 Boolean 1854 create_system_thread(size_t stack_size, 1855 void* stackaddr, 1856 void* (*start_routine)(void *), 1857 void* param) 1840 create_system_thread(size_t stack_size, void *stackaddr, 1841 void *(*start_routine)(void *), void *param) 1858 1842 { 1859 1843 pthread_attr_t attr; 1860 pthread_t returned_thread = (pthread_t) 0; 1844 pthread_t returned_thread; 1845 int err; 1861 1846 TCR *current = get_tcr(true); 1862 1847 … … 1871 1856 if (stackaddr != NULL) { 1872 1857 /* Size must have been specified. Sort of makes sense ... */ 1873 #ifdef DARWIN1874 Fatal("no pthread_attr_setsetstack. "," Which end of stack does address refer to?");1875 #else1876 1858 pthread_attr_setstack(&attr, stackaddr, stack_size); 1877 #endif1878 1859 } else if (stack_size != DEFAULT_THREAD_STACK_SIZE) { 1879 1860 pthread_attr_setstacksize(&attr,stack_size); … … 1892 1873 */ 1893 1874 LOCK(lisp_global(TCR_AREA_LOCK),current); 1894 pthread_create(&returned_thread, &attr, start_routine, param);1875 err = pthread_create(&returned_thread, &attr, start_routine, param); 1895 1876 UNLOCK(lisp_global(TCR_AREA_LOCK),current); 1896 1877 pthread_attr_destroy(&attr); 1897 return ( returned_thread != (pthread_t)0);1878 return (err == 0); 1898 1879 } 1899 1880 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
