``` unsigned int access; unsigned int type : 2; + unsigned int internal : 1; ```
How many more bitfields are you planning to use here? We could just make these uint8_t or uint16_t (or bool) instead, and that would be nicer to the compiler and the CPU.
``` + struct inproc_sync stack[2], *signal_sync = stack + 0, *wait_sync = stack + 1; ```
It's not my place to criticize style in ntdll, but why are we converting this into an array when it wasn't one previously, and why are we using pointer arithmetic to address it instead of &stack[0]?
``` @@ -108,6 +108,7 @@ struct ntdll_thread_data int request_fd; /* fd for sending server requests */ int reply_fd; /* fd for receiving server replies */ int wait_fd[2]; /* fd for sleeping server requests */ + int queue_sync_fd; /* inproc sync fd for message queue */ BOOL allow_writes; /* ThreadAllowWrites flags */ pthread_t pthread_id; /* pthread thread id */ void *kernel_stack; /* stack for thread startup and kernel syscalls */ ```
Why are we storing this in ntdll?