summary refs log tree commit diff stats
path: root/tests/stdlib/uselocks.nim
blob: f87623b5e405fee1f02b7261c87e070a396e7b26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import locks
import std/assertions

type MyType* [T] = object
  lock: Lock

proc createMyType*[T]: MyType[T] =
  initLock(result.lock)

proc use* (m: var MyType): int =
  withLock m.lock:
    result = 3

block:
  var l: Lock
  doAssert $l == "()"
an> rm -rf libmesode - wget https://cmocka.org/files/1.0/cmocka-1.0.0.tar.xz - tar -xvf cmocka-1.0.0.tar.xz - cd cmocka-1.0.0 - mkdir build - cd build - cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug .. - make - sudo make install - cd ../.. - rm -rf cmocka-1.0.0 - sudo apt-get install libmicrohttpd-dev - git clone git://github.com/boothj5/stabber.git - cd stabber - ./bootstrap.sh - ./configure --prefix=/usr - make - sudo make install - cd .. - rm -rf stabber script: ./travis-build.sh