diff options
author | Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> | 2015-09-17 19:23:48 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-11-05 12:19:09 +0100 |
commit | c16861ef1b7b27803b4c068ef778ba0f80fba1c2 (patch) | |
tree | f550dd82ac16446d302808993e548087eb1ea3f8 /replay/replay-internal.h | |
parent | c92079f45fec0bc6a2757aa3783dd9b0604089ba (diff) |
replay: introduce mutex to protect the replay log
This mutex will protect read/write operations for replay log.
Using mutex is necessary because most of the events consist of
several fields stored in the log. The mutex will help to avoid races.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Message-Id: <20150917162348.8676.8628.stgit@PASHA-ISP.def.inno>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'replay/replay-internal.h')
-rw-r--r-- | replay/replay-internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/replay/replay-internal.h b/replay/replay-internal.h index 17600deff9..8a0de0d8d8 100644 --- a/replay/replay-internal.h +++ b/replay/replay-internal.h @@ -33,6 +33,13 @@ int64_t replay_get_qword(void); void replay_get_array(uint8_t *buf, size_t *size); void replay_get_array_alloc(uint8_t **buf, size_t *size); +/* Mutex functions for protecting replay log file */ + +void replay_mutex_init(void); +void replay_mutex_destroy(void); +void replay_mutex_lock(void); +void replay_mutex_unlock(void); + /*! Checks error status of the file. */ void replay_check_error(void); |