@@ -31,7 +31,7 @@
* The new version inherits the previous ones.
*/
-LIBMULTIPATH_9.0.0 {
+LIBMULTIPATH_10.0.0 {
global:
/* symbols referenced by multipath and multipathd */
add_foreign;
@@ -284,11 +284,12 @@ global:
/* added in 8.2.0 */
check_daemon;
+ /* added in 9.1.0 */
+ timespeccmp;
+
+ /* added in 10.0.0 */
+ set_wakeup_fn;
+
local:
*;
};
-
-LIBMULTIPATH_9.1.0 {
-global:
- timespeccmp;
-} LIBMULTIPATH_9.0.0;
@@ -3,6 +3,16 @@
void cleanup_lock (void * data)
{
struct mutex_lock *lock = data;
+ wakeup_fn *fn = lock->wakeup;
- unlock(lock);
+ __unlock(lock);
+ if (fn)
+ fn();
+}
+
+void set_wakeup_fn(struct mutex_lock *lck, wakeup_fn *fn)
+{
+ lock(lck);
+ lck->wakeup = fn;
+ __unlock(lck);
}
@@ -3,8 +3,11 @@
#include <pthread.h>
+typedef void (wakeup_fn)(void);
+
struct mutex_lock {
pthread_mutex_t mutex;
+ wakeup_fn *wakeup;
};
static inline void lock(struct mutex_lock *a)
@@ -22,7 +25,7 @@ static inline int timedlock(struct mutex_lock *a, struct timespec *tmo)
return pthread_mutex_timedlock(&a->mutex, tmo);
}
-static inline void unlock(struct mutex_lock *a)
+static inline void __unlock(struct mutex_lock *a)
{
pthread_mutex_unlock(&a->mutex);
}
@@ -30,5 +33,6 @@ static inline void unlock(struct mutex_lock *a)
#define lock_cleanup_pop(a) pthread_cleanup_pop(1)
void cleanup_lock (void * data);
+void set_wakeup_fn(struct mutex_lock *lock, wakeup_fn *fn);
#endif /* _LOCK_H */
@@ -6,9 +6,9 @@
#include "lock.h"
struct vectors {
- struct mutex_lock lock; /* defined in lock.h */
vector pathvec;
vector mpvec;
+ struct mutex_lock lock; /* defined in lock.h */
};
void __set_no_path_retry(struct multipath *mpp, bool check_features);