nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Ropefix
[nit.git]
/
lib
/
pthreads
/
pthreads.nit
diff --git
a/lib/pthreads/pthreads.nit
b/lib/pthreads/pthreads.nit
index
63db6bc
..
5d6b80d
100644
(file)
--- a/
lib/pthreads/pthreads.nit
+++ b/
lib/pthreads/pthreads.nit
@@
-16,8
+16,9
@@
# Main POSIX threads support and intro the classes `Thread`, `Mutex` and `Barrier`
module pthreads is
# Main POSIX threads support and intro the classes `Thread`, `Mutex` and `Barrier`
module pthreads is
- c_compiler_option("-pthread")
- c_linker_option("-pthread")
+ cflags "-pthread"
+ ldflags "-pthread"
+ pkgconfig "bdw-gc"
end
#
end
#
@@
-34,9
+35,10
@@
in "C" `{
// TODO protect with: #ifdef WITH_LIBGC
// We might have to add the next line to gc_chooser.c too, especially
// if we get an error like "thread not registered with GC".
// TODO protect with: #ifdef WITH_LIBGC
// We might have to add the next line to gc_chooser.c too, especially
// if we get an error like "thread not registered with GC".
+ #ifndef ANDROID
#define GC_THREADS
#include <gc.h>
#define GC_THREADS
#include <gc.h>
- //#endif
+ #endif
`}
redef class Sys
`}
redef class Sys
@@
-114,13
+116,7
@@
private extern class NativePthread in "C" `{ pthread_t * `}
return (nullable_Object)thread_return;
`}
return (nullable_Object)thread_return;
`}
- fun attr: NativePthreadAttr `{
- pthread_attr_t *pattr = malloc(sizeof(pthread_attr_t));
- pthread_getattr_np(*recv, pattr);
- return pattr;
- `}
-
- fun equal(other: NativePthread): Bool `{ pthread_equal(*recv, *other); `}
+ fun equal(other: NativePthread): Bool `{ return pthread_equal(*recv, *other); `}
fun kill(signal: Int) `{ pthread_kill(*recv, signal); `}
end
fun kill(signal: Int) `{ pthread_kill(*recv, signal); `}
end