natVMAccessControlState.cc 872 B

123456789101112131415161718192021222324252627282930313233
  1. // natVMAccessControlState.cc -- Native part of the VMAccessControlState class.
  2. /* Copyright (C) 2006 Free Software Foundation, Inc.
  3. This file is part of libgcj.
  4. This software is copyrighted work licensed under the terms of the
  5. Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
  6. details. */
  7. #include <config.h>
  8. #include <gcj/cni.h>
  9. #include <jvm.h>
  10. #include <java/lang/Thread.h>
  11. #include <java/security/VMAccessControlState.h>
  12. java::security::VMAccessControlState *
  13. java::security::VMAccessControlState::getThreadState ()
  14. {
  15. java::lang::Thread *thread = java::lang::Thread::currentThread ();
  16. if (thread == NULL)
  17. return NULL;
  18. VMAccessControlState *state =
  19. reinterpret_cast<VMAccessControlState *> (thread->accessControlState);
  20. if (state == NULL)
  21. thread->accessControlState = state = new VMAccessControlState ();
  22. return state;
  23. }