#TUNING by stefan
class: Win32OperatingSystem class
changed: #getProcessId
cache my own process id
--- 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"
!
"