Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jberryman
GHC
Commits
48f462f3
Commit
48f462f3
authored
Jul 12, 2013
by
Edward Z. Yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename atomicReadMVar and friends to readMVar.
Signed-off-by:
Edward Z. Yang
<
ezyang@mit.edu
>
parent
f6e9d4fc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
24 deletions
+24
-24
compiler/prelude/primops.txt.pp
compiler/prelude/primops.txt.pp
+2
-2
includes/stg/MiscClosures.h
includes/stg/MiscClosures.h
+4
-4
rts/HeapStackCheck.cmm
rts/HeapStackCheck.cmm
+8
-8
rts/Linker.c
rts/Linker.c
+3
-3
rts/PrimOps.cmm
rts/PrimOps.cmm
+7
-7
No files found.
compiler/prelude/primops.txt.pp
View file @
48f462f3
...
...
@@ -1717,7 +1717,7 @@ primop TryPutMVarOp "tryPutMVar#" GenPrimOp
out_of_line
=
True
has_side_effects
=
True
primop
AtomicReadMVarOp
"atomicR
eadMVar#"
GenPrimOp
primop
ReadMVarOp
"r
eadMVar#"
GenPrimOp
MVar
# s a -> State# s -> (# State# s, a #)
{
If
{
\
tt
MVar
\
#} is empty, block until it becomes full.
Then
read
its
contents
without
modifying
the
MVar
,
without
possibility
...
...
@@ -1726,7 +1726,7 @@ primop AtomicReadMVarOp "atomicReadMVar#" GenPrimOp
out_of_line
=
True
has_side_effects
=
True
primop
Try
AtomicReadMVarOp
"tryAtomic
ReadMVar#"
GenPrimOp
primop
Try
ReadMVarOp
"try
ReadMVar#"
GenPrimOp
MVar
# s a -> State# s -> (# State# s, Int#, a #)
{
If
{
\
tt
MVar
\
#} is empty, immediately return with integer 0 and value undefined.
Otherwise
,
return
with
integer
1
and
contents
of
{
\
tt
MVar
\
#}.}
...
...
includes/stg/MiscClosures.h
View file @
48f462f3
...
...
@@ -293,9 +293,9 @@ RTS_FUN_DECL(stg_block_noregs);
RTS_FUN_DECL
(
stg_block_blackhole
);
RTS_FUN_DECL
(
stg_block_blackhole_finally
);
RTS_FUN_DECL
(
stg_block_takemvar
);
RTS_FUN_DECL
(
stg_block_
atomic
readmvar
);
RTS_FUN_DECL
(
stg_block_readmvar
);
RTS_RET
(
stg_block_takemvar
);
RTS_RET
(
stg_block_
atomic
readmvar
);
RTS_RET
(
stg_block_readmvar
);
RTS_FUN_DECL
(
stg_block_putmvar
);
RTS_RET
(
stg_block_putmvar
);
#ifdef mingw32_HOST_OS
...
...
@@ -378,10 +378,10 @@ RTS_FUN_DECL(stg_isEmptyMVarzh);
RTS_FUN_DECL
(
stg_newMVarzh
);
RTS_FUN_DECL
(
stg_takeMVarzh
);
RTS_FUN_DECL
(
stg_putMVarzh
);
RTS_FUN_DECL
(
stg_
atomicR
eadMVarzh
);
RTS_FUN_DECL
(
stg_
r
eadMVarzh
);
RTS_FUN_DECL
(
stg_tryTakeMVarzh
);
RTS_FUN_DECL
(
stg_tryPutMVarzh
);
RTS_FUN_DECL
(
stg_try
Atomic
ReadMVarzh
);
RTS_FUN_DECL
(
stg_tryReadMVarzh
);
RTS_FUN_DECL
(
stg_waitReadzh
);
RTS_FUN_DECL
(
stg_waitWritezh
);
...
...
rts/HeapStackCheck.cmm
View file @
48f462f3
...
...
@@ -487,7 +487,7 @@ stg_block_noregs
/* -----------------------------------------------------------------------------
* takeMVar/putMVar-specific blocks
*
* Stack layout for a thread blocked in takeMVar/
atomicR
eadMVar:
* Stack layout for a thread blocked in takeMVar/
r
eadMVar:
*
* ret. addr
* ptr to MVar (R1)
...
...
@@ -531,14 +531,14 @@ stg_block_takemvar /* mvar passed in R1 */
BLOCK_BUT_FIRST
(
stg_block_takemvar_finally
);
}
INFO_TABLE_RET ( stg_block_
atomic
readmvar, RET_SMALL, W_ info_ptr, P_ mvar )
INFO_TABLE_RET
(
stg_block_readmvar
,
RET_SMALL
,
W_
info_ptr
,
P_
mvar
)
return
()
{
jump stg_
atomicR
eadMVarzh(mvar);
jump
stg_
r
eadMVarzh
(
mvar
);
}
// code fragment executed just before we return to the scheduler
stg_block_
atomic
readmvar_finally
stg_block_readmvar_finally
{
W_
r1
,
r3
;
r1
=
R1
;
...
...
@@ -549,13 +549,13 @@ stg_block_atomicreadmvar_finally
jump
StgReturn
[
R1
];
}
stg_block_
atomic
readmvar /* mvar passed in R1 */
stg_block_readmvar
/* mvar passed in R1 */
{
Sp_adj
(
-2
);
Sp
(
1
)
=
R1
;
Sp(0) = stg_block_
atomic
readmvar_info;
R3 = R1; // mvar communicated to stg_block_
atomic
readmvar_finally in R3
BLOCK_BUT_FIRST(stg_block_
atomic
readmvar_finally);
Sp
(
0
)
=
stg_block_readmvar_info
;
R3
=
R1
;
// mvar communicated to stg_block_readmvar_finally in R3
BLOCK_BUT_FIRST
(
stg_block_readmvar_finally
);
}
INFO_TABLE_RET
(
stg_block_putmvar
,
RET_SMALL
,
W_
info_ptr
,
...
...
rts/Linker.c
View file @
48f462f3
...
...
@@ -1058,7 +1058,7 @@ typedef struct _RtsSymbolVal {
SymI_HasProto(stg_yield_to_interpreter) \
SymI_HasProto(stg_block_noregs) \
SymI_HasProto(stg_block_takemvar) \
SymI_HasProto(stg_block_
atomic
readmvar) \
SymI_HasProto(stg_block_readmvar) \
SymI_HasProto(stg_block_putmvar) \
MAIN_CAP_SYM \
SymI_HasProto(MallocFailHook) \
...
...
@@ -1315,11 +1315,11 @@ typedef struct _RtsSymbolVal {
SymI_HasProto(stg_bh_upd_frame_info) \
SymI_HasProto(suspendThread) \
SymI_HasProto(stg_takeMVarzh) \
SymI_HasProto(stg_
atomicR
eadMVarzh) \
SymI_HasProto(stg_
r
eadMVarzh) \
SymI_HasProto(stg_threadStatuszh) \
SymI_HasProto(stg_tryPutMVarzh) \
SymI_HasProto(stg_tryTakeMVarzh) \
SymI_HasProto(stg_try
Atomic
ReadMVarzh) \
SymI_HasProto(stg_tryReadMVarzh) \
SymI_HasProto(stg_unmaskAsyncExceptionszh) \
SymI_HasProto(unloadObj) \
SymI_HasProto(stg_unsafeThawArrayzh) \
...
...
rts/PrimOps.cmm
View file @
48f462f3
...
...
@@ -1406,7 +1406,7 @@ loop:
goto
loop
;
}
// There are
atomicR
eadMVar/takeMVar(s) waiting: wake up the first one
// There are
r
eadMVar/takeMVar(s) waiting: wake up the first one
tso
=
StgMVarTSOQueue_tso
(
q
);
StgMVar_head
(
mvar
)
=
StgMVarTSOQueue_link
(
q
);
...
...
@@ -1434,7 +1434,7 @@ loop:
ccall
tryWakeupThread
(
MyCapability
()
"
ptr
"
,
tso
);
// If it was an
atomicR
eadMVar, then we can still do work,
// If it was an
r
eadMVar, then we can still do work,
// so loop back. (XXX: This could take a while)
if
(
why_blocked
==
BlockedOnMVarRead
)
{
q
=
StgMVarTSOQueue_link
(
q
);
...
...
@@ -1508,7 +1508,7 @@ loop:
ccall
tryWakeupThread
(
MyCapability
()
"
ptr
"
,
tso
);
// If it was an
atomicR
eadMVar, then we can still do work,
// If it was an
r
eadMVar, then we can still do work,
// so loop back. (XXX: This could take a while)
if
(
why_blocked
==
BlockedOnMVarRead
)
{
q
=
StgMVarTSOQueue_link
(
q
);
...
...
@@ -1521,7 +1521,7 @@ loop:
return
(
1
);
}
stg_
atomicR
eadMVarzh
(
P_
mvar
,
/* :: MVar a */
)
stg_
r
eadMVarzh
(
P_
mvar
,
/* :: MVar a */
)
{
W_
val
,
info
,
tso
,
q
;
...
...
@@ -1539,7 +1539,7 @@ stg_atomicReadMVarzh ( P_ mvar, /* :: MVar a */ )
ALLOC_PRIM_WITH_CUSTOM_FAILURE
(
SIZEOF_StgMVarTSOQueue
,
unlockClosure
(
mvar
,
stg_MVAR_DIRTY_info
);
GC_PRIM_P
(
stg_
atomicR
eadMVarzh
,
mvar
));
GC_PRIM_P
(
stg_
r
eadMVarzh
,
mvar
));
q
=
Hp
-
SIZEOF_StgMVarTSOQueue
+
WDS
(
1
);
...
...
@@ -1558,7 +1558,7 @@ stg_atomicReadMVarzh ( P_ mvar, /* :: MVar a */ )
StgMVar_tail
(
mvar
)
=
q
;
}
jump
stg_block_
atomic
readmvar
(
mvar
);
jump
stg_block_readmvar
(
mvar
);
}
val
=
StgMVar_value
(
mvar
);
...
...
@@ -1567,7 +1567,7 @@ stg_atomicReadMVarzh ( P_ mvar, /* :: MVar a */ )
return
(
val
);
}
stg_try
Atomic
ReadMVarzh
(
P_
mvar
,
/* :: MVar a */
)
stg_tryReadMVarzh
(
P_
mvar
,
/* :: MVar a */
)
{
W_
val
,
info
,
tso
,
q
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment