From 53a32aac6d3d43f4e0ef835b5be9bf680079cdc2 Mon Sep 17 00:00:00 2001
From: Francesco Chemolli <li@kinkie.it>
Date: Sun, 4 Jun 2000 20:23:10 +0200
Subject: [PATCH] Added method to determine whether we are in async mode,
 mostly useful for library modules.

Rev: lib/master.pike.in:1.121
---
 lib/master.pike.in | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/master.pike.in b/lib/master.pike.in
index b057f30fff..f8165e6637 100644
--- a/lib/master.pike.in
+++ b/lib/master.pike.in
@@ -1,6 +1,6 @@
 /* -*- Pike -*-
  *	
- * $Id: master.pike.in,v 1.120 2000/05/24 01:21:33 hubbe Exp $
+ * $Id: master.pike.in,v 1.121 2000/06/04 18:23:10 kinkie Exp $
  * 
  * Master-file for Pike.
  *
@@ -910,6 +910,13 @@ mixed resolv(string identifier, string|void current_file)
 string _pike_file_name;
 string _master_file_name;
 
+//flag. Gets set to 1 if we're in async-mode (script->main() returned <0)
+private int _async=0;
+
+int asyncp() {
+  return _async;
+}
+
 /* This function is called when all the driver is done with all setup
  * of modules, efuns, tables etc. etc. and is ready to start executing
  * _real_ programs. It receives the arguments not meant for the driver
@@ -1153,6 +1160,7 @@ void _main(array(string) orig_argv, array(string) env)
   if(trace) predef::trace(trace);
   i=script->main(sizeof(argv),argv,env);
   if(i >=0) exit(i);
+  _async=1;
 }
 
 #if constant(thread_local)
-- 
GitLab