Skip to content

Commit

Permalink
Add numberOfThreads for JCryptoMiniSat
Browse files Browse the repository at this point in the history
  • Loading branch information
Lipen committed Oct 15, 2021
1 parent c26ef59 commit 60da5d9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import java.io.File
import kotlin.math.absoluteValue

@Suppress("FunctionName", "MemberVisibilityCanBePrivate", "unused")
class JCryptoMiniSat : AutoCloseable {
class JCryptoMiniSat(
val numberOfThreads: Int = 1,
) : AutoCloseable {
private var handle: Long = 0

val numberOfVariables: Int get() = cms_nvars(handle)
Expand All @@ -23,6 +25,7 @@ class JCryptoMiniSat : AutoCloseable {
if (handle != 0L) cms_delete(handle)
handle = cms_create()
if (handle == 0L) throw OutOfMemoryError("cms_create returned NULL")
setThreadNumber(numberOfThreads)
}

override fun close() {
Expand Down

0 comments on commit 60da5d9

Please sign in to comment.