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:
Axel Dörfler 2002-12-03 14:09:43 +00:00
parent 420a6221ec
commit 52bd3fc17c

View File

@ -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);
}