Commit 9016d53d authored by Kai Vogelgesang's avatar Kai Vogelgesang

Clean timespec struct creation

parent 121a1925
Pipeline #1804 failed with stages
in 1 minute and 17 seconds
......@@ -207,9 +207,7 @@ cdef class PrrtSocket:
def receive_asap_timedwait(self, deadline):
cdef char buffer[65536]
cdef int32_t len
cdef timespec deadline_timespec
deadline_timespec.tv_sec = deadline.seconds
deadline_timespec.tv_nsec = deadline.microseconds * 1000
cdef timespec deadline_timespec = timespec(deadline.seconds, deadline.microseconds * 1000)
with nogil:
len = cprrt.PrrtSocket_receive_asap_timedwait(self._c_socket, <void*> buffer, &deadline_timespec)
return buffer[:len]
......@@ -234,9 +232,7 @@ cdef class PrrtSocket:
cdef char buffer[65536]
cdef int32_t len
cdef uint32_t time_window_us = time_window * (1000**2)
cdef timespec deadline_timespec
deadline_timespec.tv_sec = deadline.seconds
deadline_timespec.tv_nsec = deadline.microseconds * 1000
cdef timespec deadline_timespec = timespec(deadline.seconds, deadline.microseconds * 1000)
with nogil:
len = cprrt.PrrtSocket_receive_ordered_timedwait(self._c_socket, <void*> buffer, time_window_us, &deadline_timespec)
return buffer[:len]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment