summaryrefslogtreecommitdiff
path: root/lib/thread/spawn+freebsd.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-05-17 22:00:50 -0700
committerOri Bernstein <ori@eigenstate.org>2016-05-17 22:00:50 -0700
commit7aac15b2bfcc5eec279aa14f9f199685f9d7e0d9 (patch)
treec9434a55ea6850aee7103f608c6333cfe3148d60 /lib/thread/spawn+freebsd.myr
parentc96238b89583ed91e92ad909c507797d00015e95 (diff)
downloadmc-7aac15b2bfcc5eec279aa14f9f199685f9d7e0d9.tar.gz
New syntax for casts.
Diffstat (limited to 'lib/thread/spawn+freebsd.myr')
-rw-r--r--lib/thread/spawn+freebsd.myr22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/thread/spawn+freebsd.myr b/lib/thread/spawn+freebsd.myr
index 63d97fe..9bf75e4 100644
--- a/lib/thread/spawn+freebsd.myr
+++ b/lib/thread/spawn+freebsd.myr
@@ -25,46 +25,46 @@ const spawnstk = {fn, sz
;;
tid = -1
/* find top of stack */
- tos = (stk castto(std.intptr)) + (sz castto(std.intptr))
+ tos = (stk : std.intptr) + (sz : std.intptr)
/* store the stack size */
tos -= sizeof(sys.size)
sz -= sizeof(sys.size)
- szp = tos castto(sys.size#)
+ szp = (tos : sys.size#)
szp# = Stacksz
/* store the function we call */
tos -= sizeof((->void))
sz -= sizeof((->void))
- fp = tos castto((->void)#)
+ fp = (tos : (->void)#)
fp# = fn
ret = sys.thr_new(&[
- .startfn = startthread castto(void#),
- .arg = tos castto(void#),
- .stkbase = stk castto(byte#),
+ .startfn = (startthread : void#),
+ .arg = (tos : void#),
+ .stkbase = (stk : byte#),
.stksz = sz,
.tid = &ctid,
.ptid = &tid,
.flags = 2,
- .rtp = 0 castto(sys.rtprio#)
+ .rtp = (0 : sys.rtprio#)
], sizeof(sys.thrparam))
if ret < 0
-> `std.Fail "couldn't spawn thread"
;;
- -> `std.Ok tid castto(tid)
+ -> `std.Ok (tid : tid)
}
const getstk = {sz
var p, m
- p = sys.mmap(0 castto(byte#), sz, sys.Mprotrw, sys.Mpriv | sys.Manon, -1, 0)
+ p = sys.mmap((0 : byte#), sz, sys.Mprotrw, sys.Mpriv | sys.Manon, -1, 0)
if p == sys.Mapbad
-> p
;;
- m = p castto(std.intptr)
- -> m castto(byte#)
+ m = (p : std.intptr)
+ -> (m : byte#)
}
const startthread = {fn : (-> void)#