This version (courtesy of Dave Grothe at GCOM) uses up/down
semaphore instead of read/write spinlocks.
Oh really?
+static int (*do_putpmsg) (int, void *, void *, int, int) = NULL;
+static int (*do_getpmsg) (int, void *, void *, int, int) = NULL;
+
+static rwlock_t streams_call_lock = RW_LOCK_UNLOCKED;
^^^^^^^^
+
+long asmlinkage sys_putpmsg(int fd, void *ctlptr, void *datptr, int band, int flags)
+{
+ int ret = -ENOSYS;
+ read_lock(&streams_call_lock);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ if (do_putpmsg)
+ ret = (*do_putpmsg) (fd, ctlptr, datptr, band, flags);
+ read_unlock(&streams_call_lock);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ return ret;
+}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/