s3-pylibsmb: Factor out py_tevent_cond_signal
authorVolker Lendecke <vl@samba.org>
Sat, 22 Sep 2012 17:40:06 +0000 (10:40 -0700)
committerVolker Lendecke <vl@samba.org>
Sun, 23 Sep 2012 14:20:20 +0000 (07:20 -0700)
source3/libsmb/pylibsmb.c

index 4225505..778df08 100644 (file)
@@ -299,10 +299,8 @@ static int py_tevent_req_wait(struct tevent_context *ev,
        return py_tevent_cond_wait(&cond);
 }
 
-static void py_tevent_signalme(struct tevent_req *req)
+static void py_tevent_cond_signal(struct py_tevent_cond *cond)
 {
-       struct py_tevent_cond *cond = (struct py_tevent_cond *)
-               tevent_req_callback_data_void(req);
        int ret;
 
        ret = pthread_mutex_lock(&cond->mutex);
@@ -316,6 +314,14 @@ static void py_tevent_signalme(struct tevent_req *req)
        assert(ret == 0);
 }
 
+static void py_tevent_signalme(struct tevent_req *req)
+{
+       struct py_tevent_cond *cond = (struct py_tevent_cond *)
+               tevent_req_callback_data_void(req);
+
+       py_tevent_cond_signal(cond);
+}
+
 #else
 
 static bool py_cli_state_setup_ev(struct py_cli_state *self)