Guard less code with the JIT mutex
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 9 Dec 2014 18:51:04 +0000 (18:51 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 9 Dec 2014 18:51:04 +0000 (18:51 +0000)
commit38771e4e1fdacfbdac5a14e50fcc0538577b1bdb
treedcf6ca65f430649752f2bbeab9e80301f3820f24
parent38f4f64124c88933acc76325a256950d468022fa
Guard less code with the JIT mutex

gcc/jit/ChangeLog:
* jit-playback.c (gcc::jit::playback::context::compile): Acquire the
mutex here, immediately before using toplev, and release it here, on
each exit path after acquisition.
(jit_mutex): Move this variable here, from jit-recording.c.
(gcc::jit::playback::context::acquire_mutex): New function, based on
code in jit-recording.c.
(gcc::jit::playback::context::release_mutex): Likewise.
* jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
function.
(gcc::jit::playback::context::release_mutex): New function.
* jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
(gcc::jit::recording::context::compile): Move mutex-handling from
here into jit-playback.c's gcc::jit::playback::context::compile.
* notes.txt: Update to show the new locations of ACQUIRE_MUTEX
and RELEASE_MUTEX.

From-SVN: r218528
gcc/jit/ChangeLog
gcc/jit/jit-playback.c
gcc/jit/jit-playback.h
gcc/jit/jit-recording.c
gcc/jit/notes.txt