[prev in list] [next in list] [prev in thread] [next in thread] 

List:       launchd-changes
Subject:    [launchd-changes] [22925] trunk/launchd/src/launchd_core_logic.c
From:       source_changes () macosforge ! org (source_changes () macosforge ! org)
Date:       2006-10-27 10:59:13
Message-ID: 20061027175251.3D94625C069 () cvs ! opensource ! apple ! com
[Download RAW message or body]

Revision: 22925
          http://trac.macosforge.org/projects/launchd/changeset/22925
Author:   zarzycki@apple.com
Date:     2006-10-27 10:52:50 -0700 (Fri, 27 Oct 2006)

Log Message:
-----------
Since Mach service lookups are O(n) right now, let's keep the popular (MRU) services \
at the head of the list.

Modified Paths:
--------------
    trunk/launchd/src/launchd_core_logic.c

Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c	2006-10-26 21:50:06 UTC (rev 22924)
+++ trunk/launchd/src/launchd_core_logic.c	2006-10-27 17:52:50 UTC (rev 22925)
@@ -3040,6 +3040,10 @@
 
 		SLIST_FOREACH(ms, &ji->machservices, sle) {
 			if (strcmp(name, ms->name) == 0) {
+				if (ji->parent) {
+					SLIST_REMOVE(&ji->parent->jobs, ji, job_s, sle);
+					SLIST_INSERT_HEAD(&ji->parent->jobs, ji, sle);
+				}
 				return ms;
 			}
 		}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20061027/46f798b4/attachment.html



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic