- Timestamp:
- Sep 16, 2021, 2:22:01 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 432bffe, 7e7a076
- Parents:
- a8367eb (diff), 140eb16 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- libcfa/src
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/Makefile.am
ra8367eb r4d8fbf4 87 87 containers/pair.hfa \ 88 88 containers/result.hfa \ 89 containers/string.hfa \ 90 containers/string_res.hfa \ 89 91 containers/vector.hfa \ 90 92 device/cpu.hfa … … 194 196 $(CFACOMPILE) -quiet -XCFA,-l ${<} -c -o ${@} 195 197 198 concurrency/io/call.cfa: $(srcdir)/concurrency/io/call.cfa.in 199 ${AM_V_GEN}python3 $< > $@ 200 196 201 #---------------------------------------------------------------------------------------------------------------- 197 202 libcfa_la_SOURCES = ${libsrc} -
libcfa/src/concurrency/kernel.cfa
ra8367eb r4d8fbf4 22 22 #include <errno.h> 23 23 #include <stdio.h> 24 #include <string.h> 24 25 #include <signal.h> 25 26 #include <unistd.h> … … 31 32 #include "kernel_private.hfa" 32 33 #include "preemption.hfa" 34 #include "strstream.hfa" 35 #include "device/cpu.hfa" 33 36 34 37 //Private includes … … 231 234 __cfadbg_print_safe(runtime_core, "Kernel : core %p waiting on eventfd %d\n", this, this->idle); 232 235 233 __disable_interrupts_hard(); 234 eventfd_t val; 235 eventfd_read( this->idle, &val ); 236 __enable_interrupts_hard(); 236 { 237 eventfd_t val; 238 ssize_t ret = read( this->idle, &val, sizeof(val) ); 239 if(ret < 0) { 240 switch((int)errno) { 241 case EAGAIN: 242 #if EAGAIN != EWOULDBLOCK 243 case EWOULDBLOCK: 244 #endif 245 case EINTR: 246 // No need to do anything special here, just assume it's a legitimate wake-up 247 break; 248 default: 249 abort( "KERNEL : internal error, read failure on idle eventfd, error(%d) %s.", (int)errno, strerror( (int)errno ) ); 250 } 251 } 252 } 237 253 238 254 #if !defined(__CFA_NO_STATISTICS__) -
libcfa/src/device/cpu.cfa
ra8367eb r4d8fbf4 422 422 } 423 423 } 424 425 cpu_info_t cpu_info; -
libcfa/src/device/cpu.hfa
ra8367eb r4d8fbf4 30 30 }; 31 31 32 cpu_info_t cpu_info;32 extern cpu_info_t cpu_info; -
libcfa/src/fstream.cfa
ra8367eb r4d8fbf4 124 124 void open( ofstream & os, const char name[], const char mode[] ) { 125 125 FILE * file = fopen( name, mode ); 126 #ifdef __CFA_DEBUG__126 // #ifdef __CFA_DEBUG__ 127 127 if ( file == 0p ) { 128 128 throw (Open_Failure){ os }; 129 129 // abort | IO_MSG "open output file \"" | name | "\"" | nl | strerror( errno ); 130 130 } // if 131 #endif // __CFA_DEBUG__131 // #endif // __CFA_DEBUG__ 132 132 (os){ file }; 133 133 } // open … … 262 262 void open( ifstream & is, const char name[], const char mode[] ) { 263 263 FILE * file = fopen( name, mode ); 264 #ifdef __CFA_DEBUG__264 // #ifdef __CFA_DEBUG__ 265 265 if ( file == 0p ) { 266 266 throw (Open_Failure){ is }; 267 267 // abort | IO_MSG "open input file \"" | name | "\"" | nl | strerror( errno ); 268 268 } // if 269 #endif // __CFA_DEBUG__269 // #endif // __CFA_DEBUG__ 270 270 is.file$ = file; 271 271 } // open -
libcfa/src/memory.cfa
ra8367eb r4d8fbf4 155 155 156 156 forall(T &) 157 T * release(unique_ptr(T) & this) { 158 T * data = this.data; 159 this.data = 0p; 160 return data; 161 } 162 163 forall(T &) 157 164 int ?==?(unique_ptr(T) const & this, unique_ptr(T) const & that) { 158 165 return this.data == that.data; -
libcfa/src/memory.hfa
ra8367eb r4d8fbf4 94 94 95 95 forall(T &) 96 T * release(unique_ptr(T) & this); 97 98 forall(T &) 96 99 int ?==?(unique_ptr(T) const & this, unique_ptr(T) const & that); 97 100 forall(T &)
Note: See TracChangeset
for help on using the changeset viewer.