Merge pull request #1636 from rbehrends/fix-thread-issues
Fix some thread issues
This commit is contained in:
commit
f34ee51154
2 changed files with 1 additions and 12 deletions
|
|
@ -1061,8 +1061,7 @@ proc genMainProc(m: BModule) =
|
||||||
gBreakpoints.app(m.genFilenames)
|
gBreakpoints.app(m.genFilenames)
|
||||||
|
|
||||||
let initStackBottomCall =
|
let initStackBottomCall =
|
||||||
if emulatedThreadVars() or
|
if platform.targetOS == osStandalone: "".toRope
|
||||||
platform.targetOS == osStandalone: "".toRope
|
|
||||||
else: ropecg(m, "\t#initStackBottomWith((void *)&inner);$N")
|
else: ropecg(m, "\t#initStackBottomWith((void *)&inner);$N")
|
||||||
inc(m.labels)
|
inc(m.labels)
|
||||||
appcg(m, m.s[cfsProcs], PreMainBody, [
|
appcg(m, m.s[cfsProcs], PreMainBody, [
|
||||||
|
|
|
||||||
|
|
@ -116,16 +116,6 @@ else:
|
||||||
proc pthread_cancel(a1: TSysThread): cint {.
|
proc pthread_cancel(a1: TSysThread): cint {.
|
||||||
importc: "pthread_cancel", header: "<pthread.h>".}
|
importc: "pthread_cancel", header: "<pthread.h>".}
|
||||||
|
|
||||||
proc acquireSysTimeoutAux(L: var TSysLock, timeout: var Ttimespec): cint {.
|
|
||||||
importc: "pthread_mutex_timedlock", header: "<time.h>".}
|
|
||||||
|
|
||||||
proc acquireSysTimeout(L: var TSysLock, msTimeout: int) {.inline.} =
|
|
||||||
var a: Ttimespec
|
|
||||||
a.tv_sec = msTimeout div 1000
|
|
||||||
a.tv_nsec = (msTimeout mod 1000) * 1000
|
|
||||||
var res = acquireSysTimeoutAux(L, a)
|
|
||||||
if res != 0'i32: raise newException(EResourceExhausted, $strerror(res))
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TThreadVarSlot {.importc: "pthread_key_t", pure, final,
|
TThreadVarSlot {.importc: "pthread_key_t", pure, final,
|
||||||
header: "<sys/types.h>".} = object
|
header: "<sys/types.h>".} = object
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue