Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

27
LINES

< > BotCompany Repo | #1016403 // tempActivity - record current activity - version actually doing something

JavaX fragment (include)

1  
sclass _Activity {
2  
  long started;
3  
  O r;
4  
  Thread thread;
5  
}
6  
7  
static Set<_Activity> tempActivity_list = synchroHashSet();
8  
sbool tempActivity_debug;
9  
10  
static AutoCloseable tempActivity(fO r) {
11  
  if (tempActivity_debug) print("Activity started: " + r);
12  
  final new _Activity a;
13  
  a.started = sysNow();
14  
  a.r = r;
15  
  a.thread = currentThread();
16  
  tempActivity_list.add(a);
17  
  ret new AutoCloseable {
18  
    public void close() {
19  
      tempActivity_list.remove(a);
20  
      if (tempActivity_debug) {
21  
        int n = l(tempActivity_list);
22  
        print("Activity ended: " + r
23  
          + (n == 0 ? "" : " - " + n + " remaining"));
24  
      }
25  
    }
26  
  };
27  
}

Author comment

Began life as a copy of #1014792

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016403
Snippet name: tempActivity - record current activity - version actually doing something
Eternal ID of this version: #1016403/3
Text MD5: 1b5bb6a434570697573510ad990b1958
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-17 00:42:06
Source code size: 663 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 247 / 291
Version history: 2 change(s)
Referenced in: [show references]