]> sourceware.org Git - systemtap.git/commitdiff
2005-10-17 Martin Hunt <hunt@redhat.com>
authorhunt <hunt>
Tue, 18 Oct 2005 04:34:05 +0000 (04:34 +0000)
committerhunt <hunt>
Tue, 18 Oct 2005 04:34:05 +0000 (04:34 +0000)
* transport.c (_stp_handle_start): Grab semaphore before
calling probe_start() and release after it is done.
(_stp_handle_exit): Ditto for exiting. This prevents
exiting before probe_start() is finished.

runtime/transport/ChangeLog
runtime/transport/transport.c

index f2a8c54d20df791a4f9f40a5f50378c7407aa8bd..62baa4163d3bbee02c2a119cce526531375b23e2 100644 (file)
@@ -1,3 +1,10 @@
+2005-10-17  Martin Hunt  <hunt@redhat.com>
+
+       * transport.c (_stp_handle_start): Grab semaphore before
+       calling probe_start() and release after it is done.
+       (_stp_handle_exit): Ditto for exiting. This prevents
+       exiting before probe_start() is finished.
+
 2005-10-14  Tom Zanussi  <zanussi@us.ibm.com>
 
        * relayfs.h: Add ifdef'ed relayfs_fs.h include for mainline
index 89c90c96b108d531e320b95140c35d74a7e2e7ad..36d5fc5aec4b7732d2aa29e8cd412310cacae0ce 100644 (file)
@@ -19,6 +19,8 @@ static struct rchan *_stp_chan;
 static struct dentry *_stp_dir;
 #endif
 
+static DECLARE_MUTEX(_stp_start_mutex);
+
 static int _stp_dpid;
 static int _stp_pid;
 
@@ -95,7 +97,11 @@ static void _stp_handle_buf_info(int *cpuptr)
 void _stp_handle_start (struct transport_start *st)
 {
        kbug ("stp_handle_start pid=%d\n", st->pid);
+
+       down (&_stp_start_mutex);
        st->pid = probe_start();
+       up (&_stp_start_mutex);
+
        if (st->pid < 0) 
                _stp_exit_called = 1;
        _stp_transport_send(STP_START, st, sizeof(*st));
@@ -140,7 +146,9 @@ static void _stp_cleanup_and_exit (int closing)
  */
 static void _stp_handle_exit (void *data)
 {
+       down (&_stp_start_mutex);
        _stp_cleanup_and_exit(0);
+       up (&_stp_start_mutex);
 }
 
 /**
This page took 0.028519 seconds and 5 git commands to generate.