source: rtems/cpukit/sapi/src/extensiondelete.c @ 36272279

5
Last change on this file since 36272279 was 36272279, checked in by Sebastian Huber <sebastian.huber@…>, on 04/08/16 at 14:23:22

sapi: Avoid Giant lock for extensions

Extension create and delete is protected by the object allocator lock.

Update #2555.

  • Property mode set to 100644
File size: 998 bytes
Line 
1/**
2 * @file
3 *
4 * @ingroup ClassicUserExtensions
5 *
6 * @brief User Extensions Implementation.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2007.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/extensionimpl.h>
23#include <rtems/score/userextimpl.h>
24
25rtems_status_code rtems_extension_delete(
26  rtems_id id
27)
28{
29  rtems_status_code  status;
30  Extension_Control *the_extension;
31
32  _Objects_Allocator_lock();
33
34  the_extension = _Extension_Get( id );
35
36  if ( the_extension != NULL ) {
37    _Objects_Close( &_Extension_Information, &the_extension->Object );
38    _User_extensions_Remove_set( &the_extension->Extension );
39    _Extension_Free( the_extension );
40    status = RTEMS_SUCCESSFUL;
41  } else {
42    status = RTEMS_INVALID_ID;
43  }
44
45  _Objects_Allocator_unlock();
46  return status;
47}
Note: See TracBrowser for help on using the repository browser.