[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/5]: Implement qemu_thread_join function
From: |
Stefan Berger |
Subject: |
[Qemu-devel] [PATCH 4/5]: Implement qemu_thread_join function |
Date: |
Thu, 24 Feb 2011 15:05:24 -0500 |
This patch provides support for 'joining a thread' by wrapping
pthread_join with qemu_thread_join.
Since the backend implementation is based on threads and I am stopping
and starting that thread during operations like 'snapshot resume', I
do use this functionality to synchronize with the TPM thread's termination
before terminating the TPM, creating a new one and loading previous state
from the time of the snapshot into the TPM.
Signed-off-by: Stefan Berger <address@hidden>
---
qemu-thread.c | 5 +++++
qemu-thread.h | 1 +
2 files changed, 6 insertions(+)
Index: qemu-git/qemu-thread.c
===================================================================
--- qemu-git.orig/qemu-thread.c
+++ qemu-git/qemu-thread.c
@@ -190,3 +190,8 @@ void qemu_thread_exit(void *retval)
{
pthread_exit(retval);
}
+
+int qemu_thread_join(QemuThread *thread, void **retval)
+{
+ return pthread_join(thread->thread, retval);
+}
Index: qemu-git/qemu-thread.h
===================================================================
--- qemu-git.orig/qemu-thread.h
+++ qemu-git/qemu-thread.h
@@ -40,5 +40,6 @@ void qemu_thread_signal(QemuThread *thre
void qemu_thread_self(QemuThread *thread);
int qemu_thread_equal(QemuThread *thread1, QemuThread *thread2);
void qemu_thread_exit(void *retval);
+int qemu_thread_join(QemuThread *thread, void **retval);
#endif
- [Qemu-devel] [PATCH 0/5]: Qemu Trusted Platform Module (TPM) integration, Stefan Berger, 2011/02/24
- [Qemu-devel] [PATCH 5/5]: Implementation of the libtpms-based backend, Stefan Berger, 2011/02/24
- [Qemu-devel] [PATCH 2/5]: Support for TPM command line options, Stefan Berger, 2011/02/24
- [Qemu-devel] [PATCH 4/5]: Implement qemu_thread_join function,
Stefan Berger <=
- [Qemu-devel] [PATCH 1/5]: Add tpm_tis driver to build process, Stefan Berger, 2011/02/24
- [Qemu-devel] [PATCH Appendix] Skeleton backend driver, Stefan Berger, 2011/02/24
- [Qemu-devel] [PATCH 3/5]: Add TPM (frontend) hardware interface (TPM TIS) to Qemu, Stefan Berger, 2011/02/24