source: tests/linking/weakso_nothd.cfa @ aa88cb9a

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since aa88cb9a was ab1b971, checked in by Thierry Delisle <tdelisle@…>, 4 years ago

blocking_lock & multiple_acquisition_lock can now be used without libcfa-thread.
Doing so will have all functions be no-ops for these locks.
If libcfa-thread is linked in, these locks will behave as proper user-level locking.

  • Property mode set to 100644
File size: 777 bytes
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// weakso_nothd.cfa --
8// test whether or not usind a weakso locks pulls in threads
9//
10// Author           : Thierry Delisle
11// Created On       : Tue Jul 16 12:14:39 2019
12// Last Modified By :
13// Last Modified On :
14// Update Count     :
15//
16
17#include <fstream.hfa>
18#include <stdlib.hfa>
19
20#include <bits/weakso_locks.hfa>
21
22int main() {
23        multiple_acquisition_lock lock;
24        lock(lock);
25        unlock(lock);
26
27        if(threading_enabled()) {
28                stdout | "YES";
29        } else {
30                stdout | "NO";
31        }
32        return 0;
33}
34
35// Local Variables: //
36// tab-width: 4 //
37// compile-command: "cfa nothreads.cfa" //
38// End: //
Note: See TracBrowser for help on using the repository browser.