root / import / ext3D / trunk / install-extension3d / IzPack / src / lib / com / izforge / izpack / util / FreeThread.java @ 15280
History | View | Annotate | Download (2.73 KB)
1 |
/*
|
---|---|
2 |
* $Id: FreeThread.java,v 1.1 2006/06/14 07:29:07 cesar Exp $
|
3 |
* IzPack
|
4 |
* Copyright (C) 2002 by Elmar Grom
|
5 |
*
|
6 |
* File : FreeThread.java
|
7 |
* Description : used to free native libraries
|
8 |
* Author's email : elmar@grom.net
|
9 |
* Website : http://www.izforge.com
|
10 |
*
|
11 |
* This program is free software; you can redistribute it and/or
|
12 |
* modify it under the terms of the GNU General Public License
|
13 |
* as published by the Free Software Foundation; either version 2
|
14 |
* of the License, or any later version.
|
15 |
*
|
16 |
* This program is distributed in the hope that it will be useful,
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19 |
* GNU General Public License for more details.
|
20 |
*
|
21 |
* You should have received a copy of the GNU General Public License
|
22 |
* along with this program; if not, write to the Free Software
|
23 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
24 |
*/
|
25 |
|
26 |
package com.izforge.izpack.util; |
27 |
|
28 |
/*---------------------------------------------------------------------------*/
|
29 |
/**
|
30 |
* This class implements a thred that can be used to free native libraries
|
31 |
* safely.
|
32 |
*
|
33 |
* @version 0.0.1 / 2/6/02
|
34 |
* @author Elmar Grom
|
35 |
*/
|
36 |
/*---------------------------------------------------------------------------*/
|
37 |
public class FreeThread extends Thread |
38 |
{ |
39 |
private String name = ""; |
40 |
private NativeLibraryClient client = null; |
41 |
|
42 |
/*--------------------------------------------------------------------------*/
|
43 |
/**
|
44 |
* Standard constructor.
|
45 |
*
|
46 |
* @param name the name of the library to free. The exact form of the
|
47 |
* name may be operating system dependent. On Microsoft
|
48 |
* Windows this must be just the library name, without
|
49 |
* path but with extension.
|
50 |
* @param client reference of the client object that is linked with the
|
51 |
* library to be freed.
|
52 |
*/
|
53 |
/*--------------------------------------------------------------------------*/
|
54 |
public FreeThread (String name, |
55 |
NativeLibraryClient client) |
56 |
{ |
57 |
this.name = name;
|
58 |
this.client = client;
|
59 |
} |
60 |
/*--------------------------------------------------------------------------*/
|
61 |
/**
|
62 |
* The run() method. Frees the library. Note that the thread is likely to
|
63 |
* get 'frozen' and the application can only be treminated through a call
|
64 |
* to <code>System.exit()</code>.
|
65 |
*/
|
66 |
/*--------------------------------------------------------------------------*/
|
67 |
public void run () |
68 |
{ |
69 |
client.freeLibrary (name); |
70 |
} |
71 |
} |
72 |
/*---------------------------------------------------------------------------*/
|