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)

sclass _Activity {
  long started;
  O r;
  Thread thread;
}

static Set<_Activity> tempActivity_list = synchroHashSet();
sbool tempActivity_debug;

static AutoCloseable tempActivity(fO r) {
  if (tempActivity_debug) print("Activity started: " + r);
  final new _Activity a;
  a.started = sysNow();
  a.r = r;
  a.thread = currentThread();
  tempActivity_list.add(a);
  ret new AutoCloseable {
    public void close() {
      tempActivity_list.remove(a);
      if (tempActivity_debug) {
        int n = l(tempActivity_list);
        print("Activity ended: " + r
          + (n == 0 ? "" : " - " + n + " remaining"));
      }
    }
  };
}

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: 316 / 365
Version history: 2 change(s)
Referenced in: [show references]