Hi
Just found a bug in stop_timer() in unix/posix_thread_os_hnd.c
Looks like the same was once fixed in unix/posix_os_hnd.c, but fix was not
propagated into threaded version.
Patch is attached.
Nikita Yushchenko
From 8284c5624f40f33a0de0fa1db33f2702ff78757d Mon Sep 17 00:00:00 2001
From: Nikita Yushchenko <[email protected]>
Date: Wed, 28 Aug 2013 11:06:08 +0400
Subject: [PATCH] posix_thread_os_hnd: do not leave timer's running flag after stop
Without this patch, call to start_timer() after successul call to
stop_timer() returns EBUSY. This happens because stop_timer() does not
clean running flag.
Patch makes behaviour of posix_thread_os_hnd's stop_timer() same as
behaviour of posix_os_hnd's stop_timer() currently is.
Signed-off-by: Nikita Yushchenko <[email protected]>
---
unix/posix_thread_os_hnd.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/unix/posix_thread_os_hnd.c b/unix/posix_thread_os_hnd.c
index f839026..e863a11 100644
--- a/unix/posix_thread_os_hnd.c
+++ b/unix/posix_thread_os_hnd.c
@@ -214,7 +214,10 @@ start_timer(os_handler_t *handler,
static int
stop_timer(os_handler_t *handler, os_hnd_timer_id_t *timer_data)
{
- return sel_stop_timer(timer_data->timer);
+ int rv = sel_stop_timer(timer_data->timer);
+ if (rv == 0)
+ timer_data->running = 0;
+ return rv;
}
static int
--
1.7.2.5
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer