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
4,332
Issues
4,332
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
363
Merge Requests
363
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
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
Glasgow Haskell Compiler
GHC
Commits
88b35c17
Commit
88b35c17
authored
Aug 23, 2006
by
ei@vuokko.info
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add closeMutex and use it on clean up
parent
52589e05
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
32 additions
and
1 deletion
+32
-1
includes/OSThreads.h
includes/OSThreads.h
+1
-0
rts/Capability.c
rts/Capability.c
+3
-0
rts/Schedule.c
rts/Schedule.c
+1
-0
rts/Stable.c
rts/Stable.c
+3
-0
rts/Storage.c
rts/Storage.c
+4
-0
rts/Task.c
rts/Task.c
+4
-0
rts/Typeable.c
rts/Typeable.c
+1
-1
rts/posix/OSThreads.c
rts/posix/OSThreads.c
+5
-0
rts/win32/OSThreads.c
rts/win32/OSThreads.c
+10
-0
No files found.
includes/OSThreads.h
View file @
88b35c17
...
...
@@ -161,6 +161,7 @@ extern rtsBool waitCondition ( Condition* pCond,
// Mutexes
//
extern
void
initMutex
(
Mutex
*
pMut
);
extern
void
closeMutex
(
Mutex
*
pMut
);
//
// Thread-local storage
...
...
rts/Capability.c
View file @
88b35c17
...
...
@@ -671,6 +671,9 @@ shutdownCapability (Capability *cap, Task *task)
}
// we now have the Capability, its run queue and spare workers
// list are both empty.
// We end up here only in THREADED_RTS
closeMutex
(
&
cap
->
lock
);
}
/* ----------------------------------------------------------------------------
...
...
rts/Schedule.c
View file @
88b35c17
...
...
@@ -2584,6 +2584,7 @@ exitScheduler( void )
boundTaskExiting
(
task
);
stopTaskManager
();
}
closeMutex
(
&
sched_mutex
);
#endif
}
...
...
rts/Stable.c
View file @
88b35c17
...
...
@@ -169,6 +169,9 @@ exitStablePtrTable(void)
stgFree
(
stable_ptr_table
);
stable_ptr_table
=
NULL
;
SPT_size
=
0
;
#ifdef THREADED_RTS
closeMutex
(
&
stable_mutex
);
#endif
}
/*
...
...
rts/Storage.c
View file @
88b35c17
...
...
@@ -279,6 +279,10 @@ freeStorage (void)
stgFree
(
generations
[
g
].
steps
);
stgFree
(
generations
);
freeAllMBlocks
();
#if defined(THREADED_RTS)
closeMutex
(
&
sm_mutex
);
closeMutex
(
&
atomic_modify_mutvar_mutex
);
#endif
}
/* -----------------------------------------------------------------------------
...
...
rts/Task.c
View file @
88b35c17
...
...
@@ -77,6 +77,10 @@ stopTaskManager (void)
for
(
task
=
task_free_list
;
task
!=
NULL
;
task
=
next
)
{
next
=
task
->
next
;
stgFree
(
task
);
#if defined(THREADED_RTS)
closeCondition
(
&
task
->
cond
);
closeMutex
(
&
task
->
lock
);
#endif
}
task_free_list
=
NULL
;
RELEASE_LOCK
(
&
sched_mutex
);
...
...
rts/Typeable.c
View file @
88b35c17
...
...
@@ -20,7 +20,7 @@ void
exitTypeableStore
()
{
#ifdef THREADED_RTS
/* TODO: Free Mutex! */
closeMutex
(
&
typeableStoreLock
);
#endif
if
(
typeableStore
!=
0
)
{
freeStablePtr
((
StgStablePtr
)
typeableStore
);
...
...
rts/posix/OSThreads.c
View file @
88b35c17
...
...
@@ -106,6 +106,11 @@ initMutex(Mutex* pMut)
#endif
return
;
}
void
closeMutex
(
Mutex
*
pMut
)
{
pthread_mutex_destroy
(
pMut
);
}
void
newThreadLocalKey
(
ThreadLocalKey
*
key
)
...
...
rts/win32/OSThreads.c
View file @
88b35c17
...
...
@@ -116,6 +116,11 @@ initMutex (Mutex* pMut)
{
InitializeCriticalSectionAndSpinCount
(
pMut
,
4000
);
}
void
closeMutex
(
Mutex
*
pMut
)
{
DeleteCriticalSection
(
pMut
);
}
#else
void
initMutex
(
Mutex
*
pMut
)
...
...
@@ -127,6 +132,11 @@ initMutex (Mutex* pMut)
*
pMut
=
h
;
return
;
}
void
closeMutex
(
Mutex
*
pMut
)
{
CloseHandle
(
*
pMut
);
}
#endif
void
...
...
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