Branch: Tag:

2017-04-23

2017-04-23 08:02:57 by Arne Goedeke <el@laramies.com>

file_read: fixed signal handling

Release interpreter lock later and require it earlier to make sure that
signals are handled correctly.

751:       buffer_set_flags(&buf, BUFFER_GROW_EXACT);    -  THREADS_ALLOW(); -  +     while (bytes) {    size_t len = MINIMUM(DIRECT_BUFSIZE, bytes);    ptrdiff_t i;
764:    break;    }    +  THREADS_ALLOW(); +     i = fd_read(fd, buffer_alloc_unsafe(&buf, len), len);    -  +  THREADS_DISALLOW(); +  +  check_threads_etc(); +     if (LIKELY(i >= 0)) {    if ((size_t)i < len) buffer_remove(&buf, len - i);    bytes -= i;
783:    }    }    -  THREADS_DISALLOW(); +     -  check_threads_etc(); -  +     if (e) {    *err = e;    return NULL;