Bananymous 
							
						 
						
							
								fb61cab70d 
								
							 
						 
						
							
							
								
								LibC: Rewrite pthread_mutex using a futex  
							
							
							
						 
						
							2025-08-21 02:52:49 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								eb7922ab88 
								
							 
						 
						
							
							
								
								LibC: Implement pthread_cond_* using a futex  
							
							
							
						 
						
							2025-08-05 03:09:24 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								658a001d91 
								
							 
						 
						
							
							
								
								LibC: Make pthread_barrier safe  
							
							... 
							
							
							
							It used to deadlock and it was not safe if more threads than the target
were attempting to wait on it. 
							
						 
						
							2025-08-05 03:09:24 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								57c9f5a8a8 
								
							 
						 
						
							
							
								
								LibC: lock mutex when pthread_cond_timedwait times out  
							
							
							
						 
						
							2025-08-05 03:09:24 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								d25a5034db 
								
							 
						 
						
							
							
								
								LibC: Update thread id on fork  
							
							
							
						 
						
							2025-08-05 03:09:24 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								f197d39aaf 
								
							 
						 
						
							
							
								
								LibC: Don't allow pthread_join to return EINTR  
							
							
							
						 
						
							2025-08-05 03:09:24 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								4a95343936 
								
							 
						 
						
							
							
								
								LibC: Make _get_uthread a macro  
							
							... 
							
							
							
							This allows nice inlining :) 
							
						 
						
							2025-08-05 03:09:24 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								4e705a91af 
								
							 
						 
						
							
							
								
								LibC: Fix pthread keys  
							
							... 
							
							
							
							I had misunderstood how these are supposed to work :D 
							
						 
						
							2025-08-05 03:09:24 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								0f2c02fb04 
								
							 
						 
						
							
							
								
								LibC: Add stubs for pthread_{get,set}schedparam  
							
							
							
						 
						
							2025-06-28 16:55:13 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								f9451915b9 
								
							 
						 
						
							
							
								
								LibC: Use `pause` in pthread spinlock locking  
							
							
							
						 
						
							2025-06-16 15:07:58 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								5ad7d7edb1 
								
							 
						 
						
							
							
								
								DynamicLoader: Fix TLS on 32 bit platform  
							
							... 
							
							
							
							There were two problems with my previous implementation
- TLS was not allocated if nothing used it. There is a fallback
  initialization in _init_libc, but this was not enough if one of the
  init functions tried to access errno.
- __tls_get_addr was not resolved. If __tls_get_addr was called through
  a plt entry, everything would just break :( 
							
						 
						
							2025-06-06 16:27:07 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								df7f245cf8 
								
							 
						 
						
							
							
								
								LibC: Implement pthread_atfork  
							
							... 
							
							
							
							Again this code is not tested but *feels* right :D 
							
						 
						
							2025-06-01 13:48:03 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								dbdefa0f4a 
								
							 
						 
						
							
							
								
								LibC: Implement pthread cancelation  
							
							... 
							
							
							
							This code is not tested at all but it looks correct xD 
							
						 
						
							2025-06-01 13:48:03 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								c957f1ddca 
								
							 
						 
						
							
							
								
								LibC: Cleanup pthread code and add some pthread_attr functions  
							
							... 
							
							
							
							errno, pthread cleanup and pthread id are now stored in uthread. This
allows using these without TLS 
							
						 
						
							2025-06-01 13:48:03 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								b774f147da 
								
							 
						 
						
							
							
								
								LibC: Implement dummy pthread_attr_{get,set}detachstate  
							
							... 
							
							
							
							detached threads are not yet supported, but this allows implementation
to make sure threads are joinable. 
							
						 
						
							2025-04-21 19:58:01 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								2a5921b9c9 
								
							 
						 
						
							
							
								
								LibC: Implement pthread_barrier  
							
							... 
							
							
							
							This is not fully working but should be fine for most cases 
							
						 
						
							2025-04-21 19:53:38 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								60cb392e97 
								
							 
						 
						
							
							
								
								LibC: Implement pthread_barrier  
							
							... 
							
							
							
							This is yet another bad sched_yield implementation :D 
							
						 
						
							2025-04-21 19:52:14 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								1c88d0d7f7 
								
							 
						 
						
							
							
								
								LibC: Implement pthread_rwlock  
							
							... 
							
							
							
							This uses the same dumb sched_yield instead of actually blocking :D 
							
						 
						
							2025-04-21 18:48:47 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								5d8dd090a9 
								
							 
						 
						
							
							
								
								LibC: Implement `pthread_once`  
							
							
							
						 
						
							2025-04-21 14:17:17 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								265b4c2b22 
								
							 
						 
						
							
							
								
								LibC: Implement `thread_equal`  
							
							
							
						 
						
							2025-04-20 03:27:16 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								db9db2cc40 
								
							 
						 
						
							
							
								
								LibC: Implement basic pthread mutexes  
							
							... 
							
							
							
							This implementation is just calling sched_yield if it could not get
mutex. This is not optimal as it does not allow the CPU to idle, but it
works for now :)
Also I did not test this code at all, but it feels correct :D 
							
						 
						
							2025-04-20 03:27:16 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								3642eabac0 
								
							 
						 
						
							
							
								
								LibC: Use BAN::atomic_* functions in pthread spinlock  
							
							... 
							
							
							
							This allows us not to reinterpret_cast pthread_spin_t to
BAN::Atomic<pthread_spin_t> which is much better :) 
							
						 
						
							2025-04-20 03:11:41 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								1ccff9478f 
								
							 
						 
						
							
							
								
								LibC: Don't define __tls_get_addr if TLS is disabled  
							
							... 
							
							
							
							This makes linking fail if something tries to use TLS :) 
							
						 
						
							2025-04-20 03:11:41 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								85f9b585f5 
								
							 
						 
						
							
							
								
								LibC: Don't yield on `pthread_spin_lock`  
							
							... 
							
							
							
							Thats kinda the whole point of spinlocks :D 
							
						 
						
							2025-04-20 03:11:41 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								01626b4c9f 
								
							 
						 
						
							
							
								
								LibC: Add stub for `pthread_detach`  
							
							
							
						 
						
							2025-04-20 03:11:41 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								a85841ca76 
								
							 
						 
						
							
							
								
								LibC: Add stub for `pthread_attr_setstacksize`  
							
							
							
						 
						
							2025-04-20 03:11:41 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								fe6c4cd0b5 
								
							 
						 
						
							
							
								
								LibC: Implement POSIX TLD area (pthread_key*)  
							
							
							
						 
						
							2025-04-20 03:11:41 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								ac90800c3c 
								
							 
						 
						
							
							
								
								Kernel/LibC/DynamicLoader: Implement thread local storage  
							
							... 
							
							
							
							For some reason this does not work on 32 bit version, so it is disabled
on that platform. I'll have to look into it later to find the bug :) 
							
						 
						
							2025-04-15 23:33:39 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								08f5833ca8 
								
							 
						 
						
							
							
								
								Kernel/LibC: Implement pthread_attr_init  
							
							
							
						 
						
							2025-04-15 23:31:17 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								36baf7b0af 
								
							 
						 
						
							
							
								
								Kernel/LibC/DynamicLoader: Update process start ABI  
							
							... 
							
							
							
							We now use SysV abi for process startup 
							
						 
						
							2025-04-15 23:05:52 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								5539d5eed0 
								
							 
						 
						
							
							
								
								LibC: Implement pthread_cleanup_{pop,push}  
							
							
							
						 
						
							2025-04-15 21:48:38 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								be786be67d 
								
							 
						 
						
							
							
								
								Kernel/LibC: Implement pthread_join  
							
							
							
						 
						
							2025-04-02 12:58:39 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								e85b18e206 
								
							 
						 
						
							
							
								
								LibC: Fix pthread stack alignment  
							
							
							
						 
						
							2025-04-02 12:58:39 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								f32f62dfc1 
								
							 
						 
						
							
							
								
								LibC: Implement pthread_spin_* functions  
							
							
							
						 
						
							2025-04-02 12:58:39 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								5549696c3a 
								
							 
						 
						
							
							
								
								Kernel/LibC: Implement pthread_self  
							
							
							
						 
						
							2025-04-02 02:39:29 +03:00  
				
					
						
							
							
								
								Bananymous 
							
						 
						
							
								c1618e2b5d 
								
							 
						 
						
							
							
								
								Kernel/LibC: Add basic support for pthread_{create,exit}  
							
							
							
						 
						
							2025-04-01 23:26:13 +03:00