Changeset 0f56058


Ignore:
Timestamp:
Apr 10, 2018, 5:50:27 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, with_gc
Children:
2ae8507
Parents:
8ad6533
Message:

divide "time" into type and functions

Location:
src
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/Makefile.am

    r8ad6533 r0f56058  
    1111## Created On       : Sun May 31 08:54:01 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Sun Apr  8 23:49:34 2018
    14 ## Update Count     : 227
     13## Last Modified On : Tue Apr 10 15:20:28 2018
     14## Update Count     : 230
    1515###############################################################################
    1616
     
    100100        math                            \
    101101        gmp                             \
     102        time_t.h                        \
    102103        bits/align.h            \
    103104        bits/containers.h               \
  • src/libcfa/Makefile.in

    r8ad6533 r0f56058  
    264264        containers/result containers/vector concurrency/coroutine \
    265265        concurrency/thread concurrency/kernel concurrency/monitor \
    266         ${shell find stdhdr -type f -printf "%p "} math gmp \
     266        ${shell find stdhdr -type f -printf "%p "} math gmp time_t.h \
    267267        bits/align.h bits/containers.h bits/defs.h bits/debug.h \
    268268        bits/locks.h concurrency/invoke.h
     
    437437        math                            \
    438438        gmp                             \
     439        time_t.h                        \
    439440        bits/align.h            \
    440441        bits/containers.h               \
  • src/libcfa/concurrency/kernel

    r8ad6533 r0f56058  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 23 17:08:20 2018
    13 // Update Count     : 3
     12// Last Modified On : Tue Apr 10 14:46:49 2018
     13// Update Count     : 10
    1414//
    1515
     
    1919
    2020#include "invoke.h"
    21 #include "time"
     21#include "time_t.h"
    2222
    2323extern "C" {
  • src/libcfa/concurrency/kernel.c

    r8ad6533 r0f56058  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 30 18:26:11 2018
    13 // Update Count     : 23
     12// Last Modified On : Mon Apr  9 16:11:46 2018
     13// Update Count     : 24
    1414//
    1515
     
    2525
    2626//CFA Includes
     27#include "time"
    2728#include "kernel_private.h"
    2829#include "preemption.h"
  • src/libcfa/time

    r8ad6533 r0f56058  
    1010// Created On       : Wed Mar 14 23:18:57 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Apr  9 13:10:23 2018
    13 // Update Count     : 616
     12// Last Modified On : Tue Apr 10 17:25:34 2018
     13// Update Count     : 622
    1414//
    1515
     
    2727enum { TIMEGRAN = 1_000_000_000LL };                                    // nanosecond granularity, except for timeval
    2828
     29#include <time_t.h>                                                                             // Duration (constructors) / Time (constructors)
    2930
    3031//######################### Duration #########################
    3132
    32 struct Duration {                                                                               // private
    33         int64_t tv;                                                                                     // nanoseconds
    34 }; // Duration
    35 
    36 static inline void ?{}( Duration & dur ) with( dur ) { tv = 0; }
    37 static inline void ?{}( Duration & dur, Duration d ) with( dur ) { tv = d.tv; }
    38 
    39 static inline void ?{}( Duration & dur, zero_t ) with( dur ) { tv = 0; }
    4033static inline Duration ?=?( Duration & dur, zero_t ) { return dur{ 0 }; }
    4134
     
    155148//######################### Time #########################
    156149
    157 struct Time {                                                                                   // private
    158         uint64_t tv;                                                                            // nanoseconds since UNIX epoch
    159 }; // Time
    160 
    161 static inline void ?{}( Time & t ) with( t ) { tv = 0; } // fast
    162 void ?{}( Time & time, int year, int month = 0, int day = 0, int hour = 0, int min = 0, int sec = 0, int nsec = 0 ); // slow
    163 
    164 static inline void ?{}( Time & t, zero_t ) { t.tv = 0; }
    165150static inline Time ?=?( Time & t, zero_t ) { return t{ 0 }; }
    166151
     
    247232} // resetClock
    248233
    249 static inline void ?{}( Clock & clk ) {
    250         resetClock( clk );
    251 } // Clock
    252 
    253 static inline void ?{}( Clock & clk, Duration adj ) {
    254         resetClock( clk, adj );
    255 } // Clock
     234static inline void ?{}( Clock & clk ) { resetClock( clk ); }
     235static inline void ?{}( Clock & clk, Duration adj ) { resetClock( clk, adj ); }
    256236
    257237static inline Duration getRes() {
  • src/tests/concurrent/preempt.c

    r8ad6533 r0f56058  
    11#include <kernel>
    22#include <thread>
     3#include <time>
    34
    45#ifndef PREEMPTION_RATE
  • src/tests/concurrent/signal/block.c

    r8ad6533 r0f56058  
    1212#include <stdlib>
    1313#include <thread>
    14 
    15 #include <time.h>
     14#include <time>
    1615
    1716#ifdef LONG_TEST
  • src/tests/concurrent/signal/disjoint.c

    r8ad6533 r0f56058  
    33#include <monitor>
    44#include <thread>
    5 
    6 #include <time.h>
     5#include <time>
    76
    87#ifdef LONG_TEST
  • src/tests/concurrent/signal/wait.c

    r8ad6533 r0f56058  
    1010#include <stdlib>
    1111#include <thread>
    12 
    13 #include <time.h>
     12#include <time>
    1413
    1514#ifdef LONG_TEST
Note: See TracChangeset for help on using the changeset viewer.