Index: src/libcfa/concurrency/alarm.c
===================================================================
--- src/libcfa/concurrency/alarm.c	(revision a4683611af148ee016d982cf7b4d6480ab77e6fe)
+++ src/libcfa/concurrency/alarm.c	(revision 6cff9f347a3ec63c988f50d069c0d23f371b346a)
@@ -0,0 +1,74 @@
+//                              -*- Mode: CFA -*-
+//
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// alarm.c --
+//
+// Author           : Thierry Delisle
+// Created On       : Fri Jun 2 11:31:25 2017
+// Last Modified By : Thierry Delisle
+// Last Modified On : --
+// Update Count     : 0
+//
+
+#include "alarm.h"
+#include "kernel_private.h"
+
+static void register_self( alarm_node_t * this ) {
+	lock( &systemProcessor->alarm_lock );
+	insert( &systemProcessor->alarms, this );
+	unlock( &systemProcessor->alarm_lock );
+}
+
+void ?{}( alarm_node_t * this, thread_desc * thrd, cfa_time_t alarm, cfa_time_t period = 0 ) {
+	this->thrd = thrd;
+	this->alarm = alarm;
+	this->period = period;
+	this->next = 0;
+
+	register_self( this );
+}
+
+void ?{}( alarm_node_t * this, processor   * proc, cfa_time_t alarm, cfa_time_t period = 0 ) {
+	this->proc = proc;
+	this->alarm = alarm;
+	this->period = period;
+	this->next = 0;
+
+	register_self( this );
+}
+
+static inline void insert_at( alarm_list_t * this, alarm_node_t * n, __alarm_it_t p ) {
+	assert( !n->next );
+	if( p == this->tail ) {
+		this->tail = &n->next;
+	}
+	else {
+		n->next = *p;
+	}
+	*p = n;
+}
+
+void insert( alarm_list_t * this, alarm_node_t * n ) {
+	alarm_node_t ** it = &this->head;
+	while( (*it) && (n->alarm > (*it)->alarm) ) {
+		it = &(*it)->next;
+	}
+
+	insert_at( this, n, it );
+}
+
+void pop( alarm_list_t * this ) {
+	alarm_node_t * head = this->head;
+	if( head ) {
+		this->head = head->next;
+		if( !head->next ) {
+			this->tail = &this->head;
+		}
+		head->next = NULL;
+	}
+	return head;
+}
Index: src/libcfa/concurrency/alarm.h
===================================================================
--- src/libcfa/concurrency/alarm.h	(revision 6cff9f347a3ec63c988f50d069c0d23f371b346a)
+++ src/libcfa/concurrency/alarm.h	(revision 6cff9f347a3ec63c988f50d069c0d23f371b346a)
@@ -0,0 +1,61 @@
+//                              -*- Mode: CFA -*-
+//
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// alarm.h --
+//
+// Author           : Thierry Delisle
+// Created On       : Fri Jun 2 11:31:25 2017
+// Last Modified By : Thierry Delisle
+// Last Modified On : --
+// Update Count     : 0
+//
+
+#ifndef ALARM_H
+#define ALARM_H
+
+#include "assert"
+
+typedef unsigned long int cfa_time_t;
+
+struct thread_desc;
+struct processor;
+
+struct alarm_node_t {
+	cfa_time_t alarm;		// time when alarm goes off
+	cfa_time_t period;	// if > 0 => period of alarm
+	alarm_node_t * next;	// intrusive link list field
+
+	union {
+		thread_desc * thrd;	// thrd who created event
+		processor * proc;		// proc who created event
+	};
+};
+
+typedef alarm_node_t ** __alarm_it_t;
+
+void ?{}( alarm_node_t * this, thread_desc * thrd, cfa_time_t alarm, cfa_time_t period = 0 );
+void ?{}( alarm_node_t * this, processor   * proc, cfa_time_t alarm, cfa_time_t period = 0 );
+
+struct alarm_list_t {
+	alarm_node_t * head;
+	__alarm_it_t tail;
+};
+
+static inline void ?{}( alarm_list_t * this ) {
+	this->head = 0;
+	this->tail = &this->head;
+}
+
+void insert( alarm_list_t * this, alarm_node_t * n );
+alarm_node_t * pop( alarm_list_t * this );
+
+#endif
+
+// Local Variables: //
+// mode: CFA //
+// tab-width: 6 //
+// End: //
