]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/UserNotification/KUNCUserNotifications.c
xnu-1456.1.26.tar.gz
[apple/xnu.git] / osfmk / UserNotification / KUNCUserNotifications.c
index f3a831af54844d9656d3eb4b249fab28e1cb70ca..740b8f12571b3bb26963d86a91f3eb86685065f5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2006 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
  */
 
 struct UNDReply {
-       decl_mutex_data(,lock)                          /* UNDReply lock */
+       decl_lck_mtx_data(,lock)                                /* UNDReply lock */
        int                             userLandNotificationKey;
        KUNCUserNotificationCallBack    callback;
        boolean_t                       inprogress;
        ipc_port_t                      self_port;      /* Our port */
 };
 
-#define UNDReply_lock(reply)           mutex_lock(&reply->lock)
-#define UNDReply_lock_try(reply)       mutex_lock_try(&(reply)->lock)
-#define UNDReply_unlock(reply)         mutex_unlock(&(reply)->lock)
+#define UNDReply_lock(reply)           lck_mtx_lock(&reply->lock)
+#define UNDReply_unlock(reply)         lck_mtx_lock(&reply->lock)
 
 /* forward declarations */
 void UNDReply_deallocate(
@@ -116,7 +115,11 @@ UNDAlertCompletedWithResult_rpc (
         UNDReplyRef            reply,
         int                    result,
         xmlData_t              keyRef,         /* raw XML bytes */
+#ifdef KERNEL_CF
         mach_msg_type_number_t keyLen)
+#else
+        __unused mach_msg_type_number_t        keyLen)
+#endif
 {
 #ifdef KERNEL_CF
        CFStringRef             xmlError = NULL;
@@ -145,7 +148,7 @@ UNDAlertCompletedWithResult_rpc (
 #endif /* KERNEL_CF */
 
        if (reply->callback) {
-               (reply->callback)((KUNCUserNotificationID) reply, result, dict);
+               (reply->callback)((int)(KUNCUserNotificationID)reply, result, dict);
        }
 
        UNDReply_lock(reply);
@@ -186,9 +189,10 @@ UNDNotificationCreated_rpc (
  * KUNC Functions
 */
 
+extern lck_grp_t LockCompatGroup;
 
 KUNCUserNotificationID
-KUNCGetNotificationID()
+KUNCGetNotificationID(void)
 {
        UNDReplyRef reply;
 
@@ -199,7 +203,7 @@ KUNCGetNotificationID()
                        kfree(reply, sizeof(struct UNDReply));
                        reply = UND_REPLY_NULL;
                } else {
-                       mutex_init(&reply->lock, 0);
+                       lck_mtx_init(&reply->lock, &LockCompatGroup, LCK_ATTR_NULL);
                        reply->userLandNotificationKey = -1;
                        reply->inprogress = FALSE;
                        ipc_kobject_set(reply->self_port,