* plugin.c (plugin_load_plugins): Warning fix.
[deliverable/binutils-gdb.git] / gold / descriptors.h
index 359008c1f077e8b77a3291ca88c412cdfd6ca1c1..8e154a631d31d1e80485fb704d0691b2f9bc6061 100644 (file)
@@ -1,6 +1,6 @@
 // descriptors.h -- manage file descriptors for gold   -*- C++ -*-
 
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright 2008, 2009 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
 
 #include <vector>
 
+#include "gold-threads.h"
+
 namespace gold
 {
 
-class Lock;
-
 // This class manages file descriptors for gold.
 
 class Descriptors
@@ -56,12 +56,6 @@ class Descriptors
   void
   release(int descriptor, bool permanent);
 
-  // Claim the file descriptor DESCRIPTOR for a plugin.  This effectively
-  // removes the descriptor from the pool of linker-managed descriptors,
-  // as the plugin will assume responsibility for closing it.
-  void
-  claim_for_plugin(int descriptor);
-
  private:
   // Information kept for a descriptor.
   struct Open_descriptor
@@ -75,8 +69,8 @@ class Descriptors
     bool inuse;
     // Whether this is a write descriptor.
     bool is_write;
-    // Whether the descriptor has been claimed for a plugin.
-    bool is_claimed;
+    // Whether the descriptor is on the stack.
+    bool is_on_stack;
   };
 
   bool
@@ -84,6 +78,8 @@ class Descriptors
 
   // We need to lock before accessing any fields.
   Lock* lock_;
+  // Used to initialize the lock_ field exactly once.
+  Initialize_lock initialize_lock_;
   // Information for descriptors.
   std::vector<Open_descriptor> open_descriptors_;
   // Top of stack.
@@ -108,10 +104,6 @@ inline void
 release_descriptor(int descriptor, bool permanent)
 { descriptors.release(descriptor, permanent); }
 
-inline void
-claim_descriptor_for_plugin(int descriptor)
-{ descriptors.claim_for_plugin(descriptor); }
-
 } // End namespace gold.
 
 #endif // !defined(GOLD_DESCRIPTORS_H)
This page took 0.024088 seconds and 4 git commands to generate.