[gnome-dvb-daemon] Reuse thread in EPGScanner
- From: Sebastian Polsterl <sebp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-dvb-daemon] Reuse thread in EPGScanner
- Date: Sun, 19 Aug 2012 17:47:49 +0000 (UTC)
commit a14cde73ec10b623bd6dceeaf127eb7640786534
Author: Sebastian PÃlsterl <sebp k-d-w org>
Date: Sun Aug 19 19:45:58 2012 +0200
Reuse thread in EPGScanner
Previously, a new thread was created each time start was called
which lead thread leakage
https://bugzilla.gnome.org/show_bug.cgi?id=677924
src/EPGScanner.vala | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/EPGScanner.vala b/src/EPGScanner.vala
index cbd2fcc..32c789a 100644
--- a/src/EPGScanner.vala
+++ b/src/EPGScanner.vala
@@ -160,6 +160,7 @@ namespace DVB {
public bool start () {
log.debug ("Starting EPG scan for group %u (%d)", this.DeviceGroup.Id, this.stop_counter);
+ if (this.loop == null) {
this.loop = new MainLoop (this.context, false);
try {
this.worker_thread = new Thread<void*>.try ("EPG-Worker-Thread", this.worker);
@@ -167,6 +168,7 @@ namespace DVB {
log.error ("Could not create thread: %s", e.message);
return false;
}
+ }
this.stop_counter -= 1;
if (this.stop_counter > 0) return false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]