Implemented forbid_page_faults() and permit_page_faults(), added a new
field to the thread structure to keep track of the current state. forbids/permits can be nested. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2141 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
420a6221ec
commit
52bd3fc17c
@ -1808,14 +1808,18 @@ int vm_init_postthread(kernel_args *ka)
|
||||
void
|
||||
permit_page_faults(void)
|
||||
{
|
||||
// ToDo: implement me when TLS is there
|
||||
struct thread *thread = thread_get_current_thread();
|
||||
if (thread != NULL)
|
||||
atomic_add(&thread->page_faults_allowed, 1);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
forbid_page_faults(void)
|
||||
{
|
||||
// ToDo: implement me when TLS is there
|
||||
struct thread *thread = thread_get_current_thread();
|
||||
if (thread != NULL)
|
||||
atomic_add(&thread->page_faults_allowed, -1);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user