#TUNING by stefan
authorStefan Vogel <sv@exept.de>
Thu, 16 Apr 2020 16:57:05 +0200
changeset 25362 f1606835f9fb
parent 25361 4ea026855e31
child 25363 9b6be9f46f15
#TUNING by stefan class: Win32OperatingSystem class changed: #getProcessId cache my own process id
Win32OperatingSystem.st
--- a/Win32OperatingSystem.st	Thu Apr 16 16:54:50 2020 +0200
+++ b/Win32OperatingSystem.st	Thu Apr 16 16:57:05 2020 +0200
@@ -9584,15 +9584,17 @@
     "return the (windows-)processId"
 
 %{  /* NOCONTEXT */
-
-    int pid = 0;
-
-    pid = GetCurrentProcessId() & 0x3FFFFFFF;
-    RETURN ( __mkSmallInteger(pid) );
+    if (@global(MyPid) == nil) {
+        int pid = GetCurrentProcessId() & 0x3FFFFFFF;
+        @global(MyPid) = __mkSmallInteger(pid);
+    }    
+    RETURN(@global(MyPid));
 %}.
     "
      OperatingSystem getProcessId
     "
+
+    "Modified: / 16-04-2020 / 16:56:22 / stefan"
 !
 
 "